Running files in folders in loop.
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have multiple folders numbered in sequence 9D-15D and inside each folder is ther is another folder numbered in sequence S_1 to S_15 and inside each folder there are files which i would read using the matlab code which i have and save data to that folder named with S_$ and do that for all the folders present and in $D folders. I can do that in other coding language but not sure how to preceed in matlab. So if you guide or tell me where to look for it would be very helpful.
9D
S_1
%Files to read using matlab code and save data
S_2
.
.
.
S_15
10D
S_1
.
.
0 Commenti
Risposte (1)
Benjamin Kraus
il 21 Ott 2022
d = dir('**');
Once you have the list, you can loop through them to read your data and write your desired output.
You may also find the fullfile, fileparts, filesep, and exist helper functions handy when processing files like this.
You didn't specify the format of the data in the files, or the desired output format, so if you need more assitance with actually reading and writing the files, you will need to provide more specifics.
0 Commenti
Vedere anche
Categorie
Scopri di più su File Operations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!