How to arrange a Matrix in different shape?
Show older comments
Hello, I have a very simple question but cannot find the answer now. Imagine I have a matrix A=[a b c], is there any function to make it B=[c b a]? Thanks
Accepted Answer
More Answers (1)
Fangjun Jiang
on 17 May 2018
A=magic(3);
B=A(:,[3 2 1])
or
B=A(:,[end:-1:1])
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!