Hello. Please how does Euclidean distance between many points (xi, yi) works if I have 5 points for example, there should be 10 distances right? but using pdist(X) function does not return 10 distances. What am I doing wrong? Thanks

조회 수: 1 (최근 30일)

답변 (1개)

KSSV
KSSV 2018년 11월 14일
편집: KSSV 2018년 11월 14일
Note that your points should be in size 5*2. Points should be arranged in n*2 array.
P = rand(5,2) ;
d = pdist(P) ;

카테고리

Help CenterFile Exchange에서 Statistics and Machine Learning Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by