Sort 1 colum and other colums sort correspondingly
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sam
am 12 Jun. 2015
Bearbeitet: Azzi Abdelmalek
am 12 Jun. 2015
Hello,
In attach is a picture of the data set I want to sort. I want sort by 'ZYGE' in ascending way. But I don't want the column of 'ZYGE' to change alone. The data must stick together. So that all the numbers of the row stick together, but the data gets sorted by 'ZYGE'. How do I do this?
1 Kommentar
Akzeptierte Antwort
Azzi Abdelmalek
am 12 Jun. 2015
Bearbeitet: Azzi Abdelmalek
am 12 Jun. 2015
Use sortrows
v=[{'a' 'b' 'zygz' 'c'};num2cell(randi(4,10,4))] % Example
M=v(2:end,:)
out=sortrows(M,3)
0 Kommentare
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!