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 extractivonor for more fancy manipulations:doc permutedoc transposedoc reshape Related SolutionsMATLAB: Do a matrix,array This works:B = reshape(A', 1, []); MATLAB: How to make a 3×3 matrix a 9×1 matrix reshape(x,9,1)or x(:) % this creates a column vector out of a matrix Related QuestionRearrange matrix to vectorRearrangement rows of matrices
Best Answer