How to re-order a string array?
Mostrar comentarios más antiguos
currently the files are orderd like this, the value increasing by 30 each time up to 1830:

however, with the code i've used, matlab orders the files like this:

is there any way i can sort the files to match the original?
dirName = pwd;
files = dir( fullfile(dirName,'*.txt') );
files = {files.name}';
files = sortrows(files,'ascend')
Respuesta aceptada
Más respuestas (1)
DGM
el 11 de Abr. de 2022
0 votos
1 comentario
james Green
el 11 de Abr. de 2022
Categorías
Más información sobre Shifting and Sorting Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!