arrayToDims

PURPOSE ^

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

SYNOPSIS ^

function IC = arrayToDims( I, dims, padEl )

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 padEl (if padding amount is
 even then pads one more unit along the start of the dimension).

 USAGE
  IC = arrayToDims( I, dims, [padEl] )

 INPUTS
  I         - n dim array to crop window from (for arrays can only crop)
  dims      - dimensions to make I
  padEl     - [0] element with which to pad

 OUTPUTS
  IC        - cropped array

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

 See also ARRAYCROP, PADARRAY

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Wed 03-Oct-2007 13:09:09 by m2html © 2003