Azzera filtri
Azzera filtri

How to arrange a Matrix in different shape?

2 visualizzazioni (ultimi 30 giorni)
sama
sama il 17 Mag 2018
Commentato: sama il 17 Mag 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

Risposta accettata

Paolo
Paolo il 17 Mag 2018
B = fliplr(A)

Più risposte (1)

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

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by