how to sort cells by date?
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(1 个)
Walter Roberson
2015-8-24
[~, order] = datenum(A(:,1));
sortedA = A(order,:);
3 个评论
Walter Roberson
2015-8-24
编辑:Walter Roberson
2015-8-24
[~, order] = sort(datenum(A(:,1)));
sortedA = A(order,:);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!