How to read directory for folders with numbers in Matlab?
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
fatemeh Karimi
le 12 Fév 2016
Réponse apportée : fatemeh Karimi
le 16 Fév 2016
Hi,
I am trying to process data from almost 100 folders containing my data. The name of the folders is like part1, part2,..., part100 and each folder contains 4 .mat files. It is also important to know the order of the folders. How can I read these 100 data folders in a for loop? I tried the following code:
for i=1:100
A(i)= load('part',num2str(i),'\....mat');
end
but it did not work.
Thanks, Fatemeh
1 commentaire
Jan
le 12 Fév 2016
Whenever you write that something "does not work", post the error message or explain the difference between the result and your expectations.
Réponse acceptée
Plus de réponses (2)
Image Analyst
le 12 Fév 2016
Use genpath(). See my attached file for a complete demo.
0 commentaires
Voir également
Catégories
En savoir plus sur Dynamic System Models dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!