pair wise distance matric

5 views (last 30 days)
Mahdieh
Mahdieh on 14 Jul 2014
Answered: Friedrich on 14 Jul 2014
Pdist give me n (n-1)/2 distances .I want know how i can have all of distances even with repeat means n (n-1) distances.

Accepted Answer

Friedrich
Friedrich on 14 Jul 2014
Hi,
you can use squareform:
X = randn(10, 2);
D = squareform(pdist(X));

More Answers (0)

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!