Sort in ascending order for first column then descending order for the second column.
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sososasa
am 29 Mär. 2014
Kommentiert: Sososasa
am 29 Mär. 2014
Hi,
A=[1 1 1;
3 2 1;
1 3 1]
is there a way in matlab to sort rows of a matrix based on ascending order for the first column and then descending order for the second column, so the final matrix will look like this:
A=[1 3 1;
1 1 1;
3 2 1]
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!