how to load all mat files in the filenumber wise sequentially ?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
megha
el 23 de Oct. de 2023
The mat file names on my local drive ends with the increasing number (0-16) range as shown in pictute below (InFolder.png), while on MATLAB, it gets loaded in the other sequence (0,1,10,11-15,2,3-9) (As shown in figure (InMATLAB.png)). Is it possible to load all mat files in order from (0-16)?
The file has been conventionally loaded using :
"d = dir('*.mat');"
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1519461/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1519466/image.png)
0 comentarios
Respuesta aceptada
Stephen23
el 23 de Oct. de 2023
Editada: Stephen23
el 23 de Oct. de 2023
Follow this link and click the big DOWNLOAD button in the top right corner:
Unzip it onto your MATLAB search path or current directory. Then use it like this:
S = dir('*.mat');
S = nartsortfiles(S);
..etc
Another solution is to use sufficient leading zeros so that the OS/SORT returns the filenames in the required order.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Workspace Variables and MAT-Files 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!