[B,RB] = mapcrop(A,RA,xlimits,ylimits)
crops the projected map raster specified by A and raster reference
RA and returns the cropped raster B and raster
reference RB. The returned raster is cropped to limits in world
coordinates close to those specified by xlimits and
ylimits.
Crop a projected raster image and display the cropped image.
First, import a projected raster image of Boston and a map cells reference object. Then, crop the image to the limits specified by xlimits and ylimits.
Projected map raster, specified as an
M-by-N or
M-by-N-by-P numeric or
logical array.
RA — Raster reference MapCellsReference object | MapPostingsReference object
Raster reference for A, specified as a MapCellsReference object or MapPostingsReference object. The TransformationType
property of RA must be 'rectilinear'.
xlimits — Minimum and maximum x limits two-element vector
Minimum and maximum x limits, specified as a two-element numeric
vector of the form [xmin xmax], where xmax is
greater than xmin.
ylimits — Minimum and maximum y limits two-element vector
Minimum and maximum y limits, specified as a two-element numeric
vector of the form [ymin ymax], where ymax is
greater than ymin.
The exact x and y limits of
RB do not match the limits specified by
xlimits and ylimits, unless they coincide
with a cell boundary or posting location. Otherwise, the limits of
RB are slightly larger than xlimits and
ylimits.
If the limits specified by xlimits and
ylimits do not intersect the raster specified by
A and RA, then RB is
empty.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.