how can I get a list of 1s from a binary image (2d array)

2 views (last 30 days)
Hi, I am using nested for-loops to extract data, e.g. 1s from a binary image. It is really slow.
does anyone know a better way of doing this?
many thanks.

Accepted Answer

Walter Roberson
Walter Roberson on 11 Jul 2011
[r,c] = find(YourImage)

More Answers (0)

Community Treasure Hunt

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

Start Hunting!