ISLANDS
by Matt Fig
08 Sep 2008
(Updated 23 Sep 2008)
Finds all "islands" which are 4-connected components in a matrix.
|
Watch this File
|
| File Information |
| Description |
ISLANDS finds all "islands" which are 4-connected components in a matrix. The function will return three output arguments, including the largest connected island in the input matrix. See the detailed help for all descriptions.
Inspired by a recent puzzler posted here:
http://blogs.mathworks.com/pick/2008/08/18/puzzler-find-largest-connected-island/
and by the submission from Tim Davis.
Also included is a MEX-File version which runs faster than the M-File version.
Tested on 2007a and 2007b.
Please email me about bugs and other concerns. Thanks. |
| Acknowledgements |
The author wishes to acknowledge the following in the creation of this submission:
find_components
|
| MATLAB release |
MATLAB 7.5 (R2007b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (2) |
| 15 Sep 2008 |
Richard B.
|
|
|
| 31 Oct 2008 |
Tim Davis
|
|
|
| Updates |
| 11 Sep 2008 |
Added more input checking. |
| 18 Sep 2008 |
Faster mex-file. |
| 19 Sep 2008 |
M-File now twice as fast. |
| 23 Sep 2008 |
Now 3 times faster for a large binary matrix. |
|
Contact us at files@mathworks.com