sort cell array in descending order based on 2nd column
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
jahanzaib ahmad
am 26 Mär. 2019
Kommentiert: Adam Danz
am 26 Mär. 2019
i have cell array and want to sort it based on 2nd column .
i have tried this
[~,idx] = sort([AA{:,2}]);
idx([1:2:end,2:2:end]) = idx;
B = AA(idx,:);
but 2nd column in not in descending order .
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!