MATLAB: Solution for sequentially concatenating matrices

concatenateconcatenatingmergemerging

Hello,
I was wondering if there was a simple function to concatenate 2 matrices of same dimensions so that:
A=[ a c ]
[ b d ]
B=[ e g ]
[ f h ]
when concatenated it follows first column of A, then first column of B, second column of A, second column of B:
C=[a e c g]
[b f d h]
I can do it with a for loop, however I was wondering whether there was a more elegant way to do it?
Thanks

Best Answer

C = reshape(vertcat(A,B), size(A,1), []);