Code covered by the BSD License  

Highlights from
cropmat

Be the first to rate this file! 8 Downloads (last 30 days) File Size: 2.09 KB File ID: #25354
image thumbnail

cropmat

by Wolfgang Schwanghart

 

18 Sep 2009 (Updated 21 Sep 2009)

crop arrays with axis-aligned minimum bounding box

| Watch this File

File Information
Description

Often I have to extract a subset of a two-dimensional array for further analysis. Usually I do this with logical indexing. But most often the problem with logical indexing is that I get a column vector which I then have to reshape or index into a new array.

cropmat solves this problem. The function crops a subset of an array based on the axis-aligned minimum bounding rectangle. One advantage is that you can perform the operation on several matrices (e.g. coordinate matrices generated by meshgrid) at one time. Moreover, cropmat works on arrays with an arbitrary number of dimensions.

MATLAB release MATLAB 7.8 (R2009a)
Other requirements The example in the m-file requires the Image Processing Toolbox.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
21 Sep 2009

changed name of the function from clipmat to cropmat.

Tag Activity for this File
Tag Applied By Date/Time
matrix manipulation Wolfgang Schwanghart 18 Sep 2009 11:06:25
matrix Wolfgang Schwanghart 18 Sep 2009 11:06:25
image processing Wolfgang Schwanghart 21 Sep 2009 11:41:32

Contact us at files@mathworks.com