Sorting the rows of a 2-column matrix based on entries from one column.
Ältere Kommentare anzeigen
I have a matrix with two columns. The first column is numbers and the second is a string of words. I want to sort the entire matrix in ascending order based on the first column entries and without losing each number's second column pair. A simplified example is as follows:
4 Apple
3 Orange
6 Pear
1 Peach
to
1 Peach
3 Orange
4 Apple
6 Pear
2 Kommentare
the cyclist
am 16 Jun. 2017
A MATLAB matrix cannot hold text. Is this a cell array?
Kyle Reagan
am 16 Jun. 2017
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!