Effacer les filtres
Effacer les filtres

How to arrange a Matrix in different shape?

2 vues (au cours des 30 derniers jours)
sama
sama le 17 Mai 2018
Commenté : sama le 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

Réponse acceptée

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

Plus de réponses (1)

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

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by