how to sort cells by date?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 24 de Ag. de 2015
[~, order] = datenum(A(:,1));
sortedA = A(order,:);
3 comentarios
Walter Roberson
el 24 de Ag. de 2015
Editada: Walter Roberson
el 24 de Ag. de 2015
[~, order] = sort(datenum(A(:,1)));
sortedA = A(order,:);
Ver también
Categorías
Más información sobre Dates and Time en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!