how to sort cells by date?
Ältere Kommentare anzeigen
i have a column of dates DD\MM\YYYY, i want to sort them by date .

i try:
sort(A);
but it sorts them by days
how i can do this?
2 Kommentare
Walter Roberson
am 24 Aug. 2015
Is 11\5\2007 before or after 11/5/2007 ?
Amr Hashem
am 24 Aug. 2015
Antworten (1)
Walter Roberson
am 24 Aug. 2015
[~, order] = datenum(A(:,1));
sortedA = A(order,:);
3 Kommentare
Amr Hashem
am 24 Aug. 2015
Walter Roberson
am 24 Aug. 2015
Bearbeitet: Walter Roberson
am 24 Aug. 2015
[~, order] = sort(datenum(A(:,1)));
sortedA = A(order,:);
Amr Hashem
am 24 Aug. 2015
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!