How to arrange a Matrix in different shape?

1 view (last 30 days)
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

Paolo
Paolo on 17 May 2018
B = fliplr(A)

More Answers (1)

Fangjun Jiang
Fangjun Jiang on 17 May 2018
A=magic(3);
B=A(:,[3 2 1])
or
B=A(:,[end:-1:1])

Categories

Find more on Creating and Concatenating 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!