how to sort cells by date?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
i have a column of dates DD\MM\YYYY, i want to sort them by date .
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/148378/image.jpeg)
i try:
sort(A);
but it sorts them by days
how i can do this?
2 Kommentare
Antworten (1)
Walter Roberson
am 24 Aug. 2015
[~, order] = datenum(A(:,1));
sortedA = A(order,:);
3 Kommentare
Walter Roberson
am 24 Aug. 2015
Bearbeitet: Walter Roberson
am 24 Aug. 2015
[~, order] = sort(datenum(A(:,1)));
sortedA = A(order,:);
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!