trivial matrix question: how to rearrange matrices in a given order
Show older comments
Hello everyone,
I know this could seems trivial and meybe here we are talking about the very matlab basics, but as I am dealing with really big data structures, I would like to receive some support.
I have the following matrix, as shown in 1:

I would like to reshape it to be as in 2, and back again to point 1.
Thanks in advance
Accepted Answer
More Answers (1)
chicken vector
on 27 Apr 2023
Edited: chicken vector
on 27 Apr 2023
A = reshape(1:3^3,3^2,[])
B = permute(reshape(A',[],3,3),[2,1,3])
A = reshape(B,[],3)
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!