Use pdist() and vertcat() using for loop
이전 댓글 표시
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?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Hierarchical Clustering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!