The shape and size of a matrix can be altered by using the following MATLAB commands:
Matrices can be reshaped into a vector or into any other appropriately sized matrix as described below:
All the elements of a matrix A can be grouped into a single column vector b by the command b = A(:). Matrix A will be stored column wise in vector b i.e. first column is stored first, then second column and so on.
Let matrix . Reshape the matrix to a column vector.
A=[1 10 20; 2 5 6 ;7 8 9]
The following result is displayed: ...