MATLAB: How to pass from vector to matrix

matrix vector

I'd want the code that given the vector B
B=[ 1 2 8 9 0 7 1 9 8 7 2 4 5 0 8 3 3 7 6 1]
return the matrix
B=[1 2 8 9 0; 7 8 9 1 7; 2 4 5 0 8; 1 6 7 3 3]
or for example:
from A=[ 1 2 4 3 0 1 5 3 7 9]
to A=[1 2; 3 4; 0 1; 3 5; 7 9]
thanks

Best Answer

Use reshape()