How to sort one column of a matrix

34 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Stephan
Stephan il 13 Ago 2019
Modificato: Stephan il 13 Ago 2019
B = sortrows(A,-3)
  3 Commenti
Stephan
Stephan il 13 Ago 2019
Modificato: Stephan il 13 Ago 2019
note that i used
sortrows
instead of
sort

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by