MATLAB: Reshape a column vector in a row-wise direction

reshape row direction reshape

if I have column vector A= 1;2;3;4;5;6;7;8;9;10 how do I get matlab to reshape it in the row wise direction so it becomes
A= 1 2 3 4 5
6 7 8 9 10
as the reshape function seems to take it in column wise direction format?

Best Answer

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