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 vue (au cours des 30 derniers jours)

Réponses (1)

KSSV
KSSV le 14 Nov 2018
Modifié(e) : KSSV le 14 Nov 2018
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) ;

Catégories

En savoir plus sur Statistics and Machine Learning Toolbox dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by