MATLAB: How to rearrange data in matrix matrix array if I have A=[1:15]. After that, I want to rearrange matrix A to get a result: MyResult=[1 2 3 4 5; 6 7 8 9 10; 11 12 13 14 15]; How can I code to get the result like this ? Best Answer >> A = 1:15;>> reshape(A,5,3).'ans = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15>> Related SolutionsMATLAB: How to reshape this matrix result = reshape(A.',2,[]).' MATLAB: How to sort a matrix in a random order E.g.,>> x = reshape(1:24,4,6)x = 1 5 9 13 17 21 2 6 10 14 18 22 3 7 11 15 19 23 4 8 12 16 20 24>> x(:) = x(randperm(numel(x)))x = 7 12 3 19 16 23 20 24 10 11 1 17 21 14 8 5 13 18 6 22 15 4 2 9 Related QuestionArray rearrangementHow to do the following in a simpler and smarter wayHow to reshape a 2D to 3D matrix without using loops (reshape) and keeping a particular order of the elements// Wrong arragement of elemts after using “reshape”Change the data locationRearrange a given array
Best Answer