arraycrop2dims

PURPOSE ^

Pads or crops I appropriately so that size(IC)==dims.

SYNOPSIS ^

function IC = arraycrop2dims( I, dims, padelement )

DESCRIPTION ^

 Pads or crops I appropriately so that size(IC)==dims.  

 For each dimension d, if size(I,d) is larger then dims(d) then symmetrically crops along
 d (if cropping amount is odd crops one more unit from the start of the dimension).  If
 size(I,d) is smaller then dims(d) then symmetrically pads along d with padelement (if
 padding amount is even then pads one more unit along the start of the dimension).

 INPUTS
   I             - n dimensional array to crop window from
                   does not support cell arrays (except for cropping)
   dims          - dimensions to make I
   padelement    - [optional] element with which to pad (0 by default)

 OUTPUTS
   IC            - cropped array

 EXAMPLE
   I = randn(10);
   delta=1; IC = arraycrop2dims( I, size(I)-2*delta  );

 DATESTAMP
   29-Sep-2005  2:00pm

 See also ARRAYCROP_FULL, PADARRAY

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Wed 03-May-2006 23:48:50 by m2html © 2003