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 Center および File ExchangeStatistics 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