Effacer les filtres
Effacer les filtres

how to reverse matrix?

27 vues (au cours des 30 derniers jours)
eri
eri le 25 Jan 2013
Commenté : Tarek Msolli le 19 Nov 2020
i want to reverse the order of row or column, example if i have matrix
2 4 7
7 8 5
it will become(column)
7 4 2
5 8 7
or(row)
7 8 5
2 4 7

Réponses (1)

Image Analyst
Image Analyst le 25 Jan 2013
Modifié(e) : Image Analyst le 25 Jan 2013
You can use the functions flipud() and fliplr(). Here's the code:
A=[2 4 7
7 8 5]
A_Left_Right = fliplr(A)
A_Up_Down = flipud(A)
In the command window:
A =
2 4 7
7 8 5
A_Left_Right =
7 4 2
5 8 7
A_Up_Down =
7 8 5
2 4 7
  2 commentaires
Image Analyst
Image Analyst le 26 Jan 2013
eri, haven't heard back from you - doesn't this do the job?
Tarek Msolli
Tarek Msolli le 19 Nov 2020
some say that he's still waiting for a feedback to this very day, others say he gave up and decided to take his life out for the his never been able to confess his feeling to Eri, but no one is truly sure.

Connectez-vous pour commenter.

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by