Clusters lables for fuzzy c mean
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi,
I have used MATLAB code for fuzzy c mean clustering :
X= data set.
[centers,U] = fcm(X,3)
labels = ones(size(X,1),1);
for i = 1:size(X,1)
aux = U(i,:);
[elem,index] = max(aux);
labels(i,1) = index;
end
but I have an error which is :
Index exceeds matrix dimensions
Error in FCMtest (line 27)
aux = U(i,:);
Please could you determine where is the issue ?
댓글 수: 2
채택된 답변
Walter Roberson
2020년 12월 28일
Replace
for i = 1:size(X,1)
aux = U(i,:);
[elem,index] = max(aux);
labels(i,1) = index;
end
with
[~, labels] = max(U, 1);
댓글 수: 2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Clustering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!