how to cluster binary matrix in matlab ?
Mostrar comentarios más antiguos
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?
Respuestas (1)
Walter Roberson
el 30 de Mayo de 2016
1 voto
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 comentarios
Image Analyst
el 30 de Mayo de 2016
That's my guess too.
[labeledImage, numberOfRegions] = bwlabel(A);
kumud alok
el 31 de Mayo de 2016
Walter Roberson
el 31 de Mayo de 2016
[clusters, ~, clusteridx] = unique(A,'rows');
kumud alok
el 1 de Jun. de 2016
kumud alok
el 1 de Jun. de 2016
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!