MATLAB: Pair wise distance matric

codeprogramming

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.

Best Answer

Hi,
you can use squareform:
X = randn(10, 2);
D = squareform(pdist(X));