MATLAB: How to convert the 1D matrix into 2D matrix

2d matrix

I have 1D matrix.now I want to convert the 1D matrix into 2D matrix.can you give me the code to convert it?

Best Answer

By using reshape function:
A=randi([1 6],1,10); %demo data
reshape(A,2,[])