MATLAB: How to convert a vector to a matrix in Matlab

How to convert a vector to a matrix in Matlab?

Best Answer

a=[1 2 3 4 5 6 7 8 9]
reshape(a,3,3)