Function Reference
— Built-in Function: reshape (a, m, n, ...)
— Built-in Function: reshape (a, siz)

Return a matrix with the given dimensions whose elements are taken from the matrix a. The elements of the matrix are accessed in column-major order (like Fortran arrays are stored).

For example,

          reshape ([1, 2, 3, 4], 2, 2)
                1  3
                  2  4

Note that the total number of elements in the original matrix must match the total number of elements in the new matrix.

A single dimension of the return matrix can be unknown and is flagged by an empty argument.