MATLAB: Forming matrix using vector

matrix

Hi, i need to form a matrix using this vector a=[ 1 2 3 5 6 7 8 9 2 1 2], the matrix elements be A=[1 2 3 4 5 6; 7 8 9 2 1 2]
i used reshape command but it doesn't give me the sequence i want.

Best Answer

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