Import all Files of one folder in order
18 views (last 30 days)
Show older comments
Hey,
i wrote a short script to import files:
path = 'C:\Users\.....';
files = dir(path);
names = {files.name};
So Matlab creates an array listing all the file names in my selected location.
My my question is if the order of the importes files can be influenced. I don´t know by which criteria MatLab loads these files into the Workspace (maybe by file size).
Is it possible to sort this array by name that way it matches my Windows order ? Cause currently the order numbering is different to these in my windows storage system (i ordered by name cause of different reasons).
Greetings
3 Comments
Stephen23
on 8 Nov 2020
"Is it possible to sort this array by name that way it matches my Windows order ?"
Not really, for reasons that have already been discussed in detail:
Answers (1)
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!