sort a matrix in a specific way
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Homayoon
am 22 Jun. 2015
Bearbeitet: Stephen23
am 22 Jun. 2015
Dear All, Although I know how to sort a single column or row in an ascending or descending way, but I do not know how to sort a higher dimension matrix based on a single column. I hope the following example illustrate my point:
12 0 1 65
5 1 0 340
13 2 1 100
9 0 0 0
I need the matrix to be sorted based on the first column. Basically I need all rows to be sorted based on a simple sort on the first column. Here is the desired output:
5 1 0 340
9 0 0 0
12 0 1 65
13 2 1 100
I hope you will help me to figure how to sort it out! Thank you so much HRJ
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!