how to cluster binary matrix in matlab ?
이전 댓글 표시
let
A=[1 0 0 0 0 0 0 1; 1 1 1 1 1 1 0 1; 0 0 0 0 0 0 1 1; 1 1 1 1 1 1 0 1; 0 0 0 0 0 0 1 1]
how to cluster this matrix A?
답변 (1개)
Walter Roberson
2016년 5월 30일
1 개 추천
Under at least two reasonable definitions of "cluster", all of the values that are 1 are in one cluster and all of the values that are 0 are in another cluster. The most obvious "reasonable definition" there involves value, but it also happens that if you use 8-connectivity then every 1 value is "connected" to every other 1 value through a chain.
My speculation is that what you want is bwlabel() with 4 connectivity.
댓글 수: 5
Image Analyst
2016년 5월 30일
That's my guess too.
[labeledImage, numberOfRegions] = bwlabel(A);
kumud alok
2016년 5월 31일
Walter Roberson
2016년 5월 31일
[clusters, ~, clusteridx] = unique(A,'rows');
kumud alok
2016년 6월 1일
kumud alok
2016년 6월 1일
카테고리
도움말 센터 및 File Exchange에서 Hierarchical Clustering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!