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
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
Image Analyst 2016 年 5 月 30 日
That's my guess too.
[labeledImage, numberOfRegions] = bwlabel(A);
kumud alok
kumud alok 2016 年 5 月 31 日
sir i want same pattern bit strings in one cluster for example: bit strings [1 1 1 1 1 1; 1 1 1 1 1 1] in one cluster suppose this is cluster 1, now bit strings[ 0 0 0 0 1 0; 0 0 0 0 1 0] are in another cluster let cluster 2...and so on..it means same pattern bit strings should be in one cluster..which cluster algorithm is best suited for this type of clustering ..
Walter Roberson
Walter Roberson 2016 年 5 月 31 日
[clusters, ~, clusteridx] = unique(A,'rows');
kumud alok
kumud alok 2016 年 6 月 1 日
thank u..sir can i do clustering of binary matrix using hamming distance..?actually i m working on spatio-temporal data[maternal health data] so i have a binary matrix of fixed length and In the matrix 0 represent increase and 1 represent decrease..now i want to cluster the binary strings of same pattern in one cluster i mean those bit strings which shows the same behaviour should be in one cluster..how can this be possible using hamming distance..if u have any idea please help me..
kumud alok
kumud alok 2016 年 6 月 1 日
and sir this binary matrix is not an image data..

サインインしてコメントする。

質問済み:

2016 年 5 月 30 日

コメント済み:

2016 年 6 月 1 日

Community Treasure Hunt

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

Start Hunting!

Translated by