how to sort cells by date?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Walter Roberson
il 24 Ago 2015
[~, order] = datenum(A(:,1));
sortedA = A(order,:);
3 Commenti
Walter Roberson
il 24 Ago 2015
Modificato: Walter Roberson
il 24 Ago 2015
[~, order] = sort(datenum(A(:,1)));
sortedA = A(order,:);
Vedere anche
Categorie
Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!