How to sort one column of a matrix

41 vues (au cours des 30 derniers jours)
Zeynab Mousavikhamene
Zeynab Mousavikhamene le 13 Août 2019
I have a matrix that has 500 rows and 5 columns. I want to sort the matrix based on the 3 rd column. I mean rearrange the matrix based on the 3rd column descending.

Réponse acceptée

Stephan
Stephan le 13 Août 2019
Modifié(e) : Stephan le 13 Août 2019
B = sortrows(A,-3)
  3 commentaires
Stephan
Stephan le 13 Août 2019
Modifié(e) : Stephan le 13 Août 2019
note that i used
sortrows
instead of
sort
Zeynab Mousavikhamene
Zeynab Mousavikhamene le 13 Août 2019
Thanks!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices 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