How to re-order a string array?
Afficher commentaires plus anciens
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')
Réponse acceptée
Plus de réponses (1)
DGM
le 11 Avr 2022
0 votes
1 commentaire
james Green
le 11 Avr 2022
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!