Hi, please help, I have 500 files I need to sort them by order 1.mat,2.mat,3.mat... 10.mat,11.mat...

1 view (last 30 days)
list = dir('index\indexation texture\');
[d h]=size(list);
for i =3: d
ch=list(i).name;
disp(ch);
nomImage=strcat('index\indexation texture\',ch);
storedStructure = load (nomImage);
data = storedStructure.t1;
end

Accepted Answer

Walter Roberson
Walter Roberson on 6 Apr 2016
  4 Comments
Stephen23
Stephen23 on 6 Apr 2016
Edited: Stephen23 on 18 Apr 2021
If that works, then natsortfiles will also work (and it is more appropriate for sorting filenames):
list = natsortfiles(list);

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!