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 visualización (últimos 30 días)

Respuestas (1)

KSSV
KSSV el 14 de Nov. de 2018
Editada: KSSV el 14 de Nov. de 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) ;

Categorías

Más información sobre Statistics and Machine Learning Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by