How to sort the files in a folder by date?
114 views (last 30 days)
Show older comments
Hi,
For example, I have 3 image files in a folder, looks like below (Fig 1).
![10.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202264/10.png)
I then tried to get the information of the image files by:
startpath=pwd;
>> list=dir(startpath);
I get (Fig 2):
![11.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/202265/11.png)
I wonder how can I sort the files in the list (excluding the top two '.' and '..') by date (from early to late)?
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!