Use pdist() and vertcat() using for loop
Mostrar comentarios más antiguos
Hey. Gays!
I wanna calculate pairwise euclidean distance and stack this Concatenate arrays vertically.
X = rand(7,7);
n = size(X,2);
for i=1:n
C = vertcat(pdist(X(:,i)));
end
I want to get the result (7 x 21) which was stacked.
However, I just got (1 x 21) matrix.
Does anyone have idea to fix this for loop code?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Hierarchical Clustering en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!