Finding object pairs from pdist output

I used the pdist function to find the distances between a number of objects and would like to know the 10 smallest distances and which between which objects those distances are.
I have so far obtained the 10 smallest distances and their index values in the output vector through sorting. However, I don't know how I can use the index values to get what I want, which is i and j values (if the distances between all objecst were expressed in a full square form matrix).
How can I use the index values from the pdist output vector to work out i and j?
Thank you very much.

답변 (1개)

KSSV
KSSV 2017년 11월 24일

0 개 추천

Let D be the pdsit output....
iwant = D(i,j) ;

카테고리

도움말 센터File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

질문:

2017년 11월 24일

답변:

2017년 11월 24일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by