Finding the position within a matrix

Hi,
I have many clusters of zeros surrounded by ones in my binary matrix. How can I find the position of the clusters of zeros without returning positions of every single zero in the cluster. I just need the position of one zero within each of the clusters.
Thanks for your help.
Adelaide:)

댓글 수: 2

per isakson
per isakson 2012년 6월 8일
did you search for cluster in the file exchange?
Adelaide
Adelaide 2012년 6월 8일
Yes, but I am hoping to find something that is much simpler. The examples I found in file exchange were more complicated than I need. Basically, I have groups of 0s in my matrix that I want to find the position of and I am hoping there is an easy to follow way of doing so.

댓글을 달려면 로그인하십시오.

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2012년 6월 8일

0 개 추천

eg
A = [...
1 1 1 1 1 1 1 1 1 1
1 0 0 1 1 1 0 0 1 1
1 0 0 0 1 1 1 0 0 1
1 1 0 1 1 1 1 0 0 1
1 1 1 1 1 1 1 0 0 0
1 1 1 1 0 0 1 1 1 1
1 0 1 1 0 0 1 1 1 1
1 0 1 0 0 1 1 1 0 1
1 1 1 0 0 1 0 1 0 1
1 1 1 1 1 1 1 1 1 1];
STATS = regionprops(~A, 'Centroid' , 'PixelList' )

질문:

2012년 6월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by