Contents Previous Next Subchapters

Copying and Changing the Dimensions of a Matrix
Syntax y = reshape(xmn)
y = reshape(x, [mn])
See Also dim , rowdim , coldim

Description
Returns a copy of the matrix x with m rows and n columns. The column major ordering of both x and y correspond to same vector. The arguments m and n are scalars, equal to non-negative integers, and their product must equal the product of the row and column dimensions of x.

Example
If you enter
     x = [{1, 2, 3}, {4, 5, 6}]
     reshape(x, 2, 3)
O-Matrix will reply
     {
     [ 1 , 3 , 5 ]
     [ 2 , 4 , 6 ]
     }
--------------------------------------------------------------------------