MATLAB: Array rearrangement

arrays

Hi,
I have an array of MxN numbers, and I want to rearrange it so that the numbers are all in one column:
1 2 4 5 3 6 7 8
becomes
1 3 2 6 4 7 5 8
How can I do this for an array of any size?
Thanks,
Richard

Best Answer

A = A(:); %column-wise extractivon
or for more fancy manipulations:
doc permute
doc transpose
doc reshape
Related Question