# arrayCrop

## PURPOSE

Used to crop a rectangular region from an n dimensional array.

## SYNOPSIS

function I = arrayCrop( I, strLocs, endLocs, padEl )

## DESCRIPTION

     Used to crop a rectangular region from an n dimensional array.

     Guarantees that the resulting array will have dims as specified by rect
     by filling in locations with padEl if the locations are outside of array.

     USAGE
      I = arrayCrop( I, strLocs, endLocs, [padEl] )

     INPUTS
      I          - n dimensional array to crop window from
      strLocs    - locs at which to start cropping along each dim
      endLocs    - locs at which to end cropping along each dim
      padEl      - [0] element with which to pad

     OUTPUTS
      I          - cropped array

     EXAMPLE
      I=randn(10);  IC=arrayCrop( I, [-1 1], [10 10], 0 );

     See also PADARRAY, ARRAYTODIMS

     Piotr's Image&Video Toolbox      Version 2.02
     Copyright 2012 Piotr Dollar.  [pdollar-at-caltech.edu]
     Please email me if you find bugs, or have suggestions or questions!
     Licensed under the Simplified BSD License [see external/bsd.txt]