How to arrange a Matrix in different shape?

2 Ansichten (letzte 30 Tage)
sama
sama am 17 Mai 2018
Kommentiert: sama am 17 Mai 2018
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

Akzeptierte Antwort

Paolo
Paolo am 17 Mai 2018
B = fliplr(A)

Weitere Antworten (1)

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

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by