Skip to main content

Redimension

Redimension [/B/C/D/E=e /I/N=n /R/S/U/W/Y=numType ] waveName, [waveName ]...

The Redimension operation remakes the named waves, preserving their contents as much as possible.

Flags

/BConverts waves to 8-bit signed integer or unsigned integer if /U is present.
/CConverts real waves to complex.
/DConverts waves to double precision floating point.
/E=e
e =0:No special action (default).
e =1:Force reshape without converting or moving data.
e =2:Perform endian swap. See FBinRead for a discussion of endian byte ordering.
/IConverts waves to 32-bit signed integer or unsigned integer if /U is present.
/LConverts waves to 64-bit signed integer or unsigned integer if /U is present. Requires Igor Pro 7.00 or later.
/N=nn is the new number of points each wave will have. Multidimensional waves are converted to 1 dimension.
If n =-1, the wave is converted to a 1-dimensional wave with the original number of rows.
/N=(n1, n2, n3, n4 )
n1, n2, n3, n4 specify the number of rows, columns, layers, and chunks each wave will have. Trailing zeros can be omitted (e.g., /N=(n1, n2, 0, 0) can be abbreviated as /N=(n1, n2 )). If any dimension size is to remain unchanged, pass -1 for that dimension.
/RConverts complex waves to real by discarding the imaginary part.
/SConverts waves to single precision floating point.
/UConverts integer waves to unsigned.
/WConverts waves to 16-bit signed integer or unsigned integer if /U is present.
/Y=typeSpecifies wave data type. See details below.

Wave Data Types

As a replacement for the above number type flags you can use /Y=numType to set the number type as an integer code. See WaveType for code values. Do not use /Y in combination with other type flags. This technique cannot be used to change the number type without changing the real/complex setting.

Details

The waves must already exist. New points in waves that are extended are initialized to zero.

In general, Redimension does not move data from one dimension to another. For instance, if you have a 6x6 matrix wave, and you would like it to be 3x12, the rows have been shortened and the data for the last three rows is lost.

As a special case, if converting to or from a 1D wave, Redimension will leave the data in place while changing the dimensionality of the wave. For example, you can use Redimension to convert a 36-element 1D wave into a 6x6 matrix in which the elements in the first column (column 0) are the first 6 elements of the 1D wave, the elements of the second column are the next 6, etc. When redimensioning from a 1D wave, columns are filled first, then layers, followed by chunks.

Examples

Reshaping a 1D wave having 4 elements to make a 2x2 matrix:

Make/N=4 vector=x
Redimension/N=(2,2) vector

See Also

Make, DeletePoints, InsertPoints, Concatenate, SplitWave