FUNCTION REFERENCE

reshape

Change the shape of an array.

Change the shape of an array.

Syntax

reshape(A, r, c)

Syntax

reshape(A, [r c])

One size may be [] and is computed. Elements are taken in column order.

Example

reshape(1:6, 2, 3)   % [1 3 5; 2 4 6]

Differences from MATLAB: Two-dimensional results only; trailing ones are accepted.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.