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