Next Previous Contents

55. reshape

Synopsis

Reshape an array

Usage

reshape (Array_Type A, Array_Type I

Description

The reshape function changes the size of a to have the size specified by the 1-d integer array I. The elements of I specify the new dimensions of A and must be consistent with the number of elements A.

Example

If A is a 100 element 1-d array, it can be changed to a 2-d 20 by 5 array via

      reshape (A, [20, 5]);
However, reshape(A, [11,5]) will result in an error because the the [11,5] array specifies 55 elements.
See Also

array_info


Next Previous Contents