reshape() command or function reshapes a matrix or vector, after reading this MATLAB Reshape topic, you will know the theory and examples.
Syntax:
reshape(n,a,b)
- n is a matrix or vector.
- a is numbers of rows.
- b is numbers of columns.
Example: To reshape a vector into the matrix.
Output:
n =
1 2 3 56
ans =
1 3
2 56
Example: To reshape a matrix into another matrix.
Output:
n =
2 3
2 1
5 1
ans =
2 5 1
2 3 1
Related Topics
MATLAB matrix inverseinv( ) command or function gives the inverse of a matrix, after reading this MATLAB…
MATLAB diagonal matrixdiag() command or function gives diagonal elements or creates a diagonal matrix, after reading this…
MATLAB NumbersAfter reading the MATLAB Numbers topic, you will understand numbers and its classification as float,…
MATLAB linspacelinspace( ) command or function creates a row vector with elements that are linearly (equally)…
MATLAB titletitle() command puts the title on the plot, after reading this MATLAB title topic, you will…