MATLAB: Converting numbers to matrix(matrix formation)

matrix formation

If I am having some numbers, e.g
x=[ 12 12 12 2 2 2 2 3 3 ];
and now I want to convert into a matrix of 3 * 3.
Which MATLAB function is suitable for this?

Best Answer

Use the 'reshape' function.