findsubmat
by Matt Fig
04 May 2009
(Updated 17 Jun 2009)
Finds one matrix (a sub-matrix) within another.
|
Watch this File
|
| File Information |
| Description |
FINDSUBMAT find one matrix (a sub-matrix) inside another.
IDX = FINDSUBMAT(A,B) looks for and returns the linear index of the
location of matrix B within matrix A. The index IDX corresponds to the location of the first element of matrix B within matrix A. Only works for 2-d matrices or vectors, both of which may contain NaNs or Infs.
[R,C] = FINDSUBMAT(A,B) returns the row and column instead.
I would like to extend to N-D but don't have the time right now. This may be a future enhancement, but I believe the file stands on it's own just fine too.
Email me if bugs are found, thanks.
|
| MATLAB release |
MATLAB 7.4 (R2007a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 06 May 2009 |
Added ability to deal with NaNs, as suggested by Urs. S. |
| 17 Jun 2009 |
Faster engine for larger B matrices. |
|
Contact us at files@mathworks.com