close loop

1 view (last 30 days)
Mohammad Golam Kibria
Mohammad Golam Kibria on 20 Jun 2011
I =
0 0 0 0 0 0 0
0 1 1 0 1 1 0
1 0 1 0 1 0 1
0 1 1 0 1 0 1
0 0 0 0 1 1 0
0 0 0 0 0 0 0
I need how many closed regions in the matrix. Here obviously two.Is there any one to help?

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 20 Jun 2011
B = bwboundaries(I,8,'noholes')

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!