MATLAB: How to reshape a vector in a particular way

matrix manipulationreshapevector

I got a column vector
a = [a1 a2 a3 … an-1 an]'
and I wanna rearrange that in the following matrix
b = [a1 a2;a3 a4; …; an-1 an]
like the first two pairs are the rows of the matrix, any tips on how achieve this?

Best Answer

b=reshape(a,2,[])'
Related Question