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.

 采纳的回答

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

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by