Resize: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Jeremy
(Importing text file)
 
imported>Chuck
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
===Purpose===
===Purpose===
Resizes arguments to same length.
 
Resizes arguments to the same length.
 
===Synopsis===
===Synopsis===
:[xout,varargout] = resize(x,varargin)
 
:(newx,newv1,newv2,...) = resize(x,v1,v2,...);
 
===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.
 
The function will attempt to resize all inputs to the largest size of each dimension for any given input. If input is a scalar, the function will return that scalar.
 
Inputs <tt>x</tt> and <tt>v1, v2,...</tt> can be scalars, vectors, matrices, or multidimensional arrays.
 
====Inputs====
 
* '''x''' and '''v1,v2...''' = input arrays to be resized
 
====Outputs====
 
* '''newx''' and '''newv1,newv2...''' = corresponding output arrays, after resizing
 
===Examples===
===Examples===
  (newx,newv1,newv2) = resize(x,v1,v2,v3);
 
*   
There are four input arrays, with the following sizes:
*original sizes are:
: x = 2x2x2
*        x - 2x2x2
: v1 = 2x6
*        v1 - 2x6
: v2 = 4x1
*        v2 - 4x1
: v3 = 1x1
*        v3 - 1x1
 
*new sizes are:
By executing the following command,
*        newx  - 4x6x2
 
*        newv1 - 4x6x2
:(newx,newv1,newv2,newv3) = resize(x,v1,v2,v3);
*        newv2 - 4x6x2
 
*        newv3 - 1x1
The sizes of the NEW arrays will be:
: x = 4x6x2
: v1 = 4x6x2
: v2 = 4x6x2
: v3 = 1x1
 
===See Also===
===See Also===
[[repmat]]
[[repmat]]

Latest revision as of 11:51, 9 October 2008

Purpose

Resizes arguments to the same length.

Synopsis

(newx,newv1,newv2,...) = resize(x,v1,v2,...);

Description

The function will attempt to resize all inputs to the largest size of each dimension for any given input. If input is a scalar, the function will return that scalar.

Inputs x and v1, v2,... can be scalars, vectors, matrices, or multidimensional arrays.

Inputs

  • x and v1,v2... = input arrays to be resized

Outputs

  • newx and newv1,newv2... = corresponding output arrays, after resizing

Examples

There are four input arrays, with the following sizes:

x = 2x2x2
v1 = 2x6
v2 = 4x1
v3 = 1x1

By executing the following command,

(newx,newv1,newv2,newv3) = resize(x,v1,v2,v3);

The sizes of the NEW arrays will be:

x = 4x6x2
v1 = 4x6x2
v2 = 4x6x2
v3 = 1x1

See Also

repmat