Resize: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
imported>Jeremy
(Importing text file)
Line 1: Line 1:
===Purpose===
===Purpose===
Resizes arguments to same length.
Resizes arguments to same length.
===Synopsis===
===Synopsis===
:[xout,varargout] = resize(x,varargin)
:[xout,varargout] = resize(x,varargin)
===Description===
===Description===
Inputs (x) and (v) can be scalars, vectors, matrices, or multidimensional arrays. The function will attempt to resize all inputs to the largest size of each dimension for any given input as repeated multiple of itself. If input is a scalar, the function will return that scalar.
Inputs (x) and (v) can be scalars, vectors, matrices, or multidimensional arrays. The function will attempt to resize all inputs to the largest size of each dimension for any given input as repeated multiple of itself. If input is a scalar, the function will return that scalar.
===Examples===
===Examples===
   (newx,newv1,newv2) = resize(x,v1,v2,v3);
   (newx,newv1,newv2) = resize(x,v1,v2,v3);
*    '''
*    '''
**''''''original''''''''' sizes are:
**''''''original''''''''' sizes are:
*        '''x'''  - 2x2x2
*        '''x'''  - 2x2x2
*        '''v1''' - 2x6
*        '''v1''' - 2x6
*        '''v2''' - 4x1
*        '''v2''' - 4x1
*        '''v3''' - 1x1
*        '''v3''' - 1x1
*'''new''' sizes are:
*'''new''' sizes are:
*        '''newx'''  - 4x6x2
*        '''newx'''  - 4x6x2
*        '''newv1''' - 4x6x2
*        '''newv1''' - 4x6x2
*        '''newv2''' - 4x6x2
*        '''newv2''' - 4x6x2
*        '''newv3''' - 1x1
*        '''newv3''' - 1x1
===See Also===
===See Also===
[[repmat]]
[[repmat]]

Revision as of 15:26, 3 September 2008

Purpose

Resizes arguments to same length.

Synopsis

[xout,varargout] = resize(x,varargin)

Description

Inputs (x) and (v) can be scalars, vectors, matrices, or multidimensional arrays. The function will attempt to resize all inputs to the largest size of each dimension for any given input as repeated multiple of itself. If input is a scalar, the function will return that scalar.

Examples

  (newx,newv1,newv2) = resize(x,v1,v2,v3);
    • 'original'''' sizes are:
  • x - 2x2x2
  • v1 - 2x6
  • v2 - 4x1
  • v3 - 1x1
  • new sizes are:
  • newx - 4x6x2
  • newv1 - 4x6x2
  • newv2 - 4x6x2
  • newv3 - 1x1

See Also

repmat