MATLAB: How to change this matrix in this manner

matrix

how to manipulate this matrix without for loop:
A=[a1,b1,c1,d1.......;a2,b2,c2,d2..........;a3,b3,c3,d3.......;a4,b4,c4,d4....;..]
how to get this:
H=[a1,b1,a2,b2,a3,b3,......;c1,d1,c2,d2,c3,d3,........]
thank you

Best Answer

H = [reshape(reshape(A(:,1:2),[],2)',[],1);reshape(reshape(A(:,3:4),[],2)',[],1)];