Resize: Difference between revisions
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=== | ||
: | |||
:(newx,newv1,newv2,...) = resize(x,v1,v2,...); | |||
===Description=== | ===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 <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=== | ||
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=== | ===See Also=== | ||
[[repmat]] | [[repmat]] |
Latest revision as of 10: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