read .png from different subfolder
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have a folder with a lot of subfolders. I want to read all .png in one subfolder and save and then go to the second subfolder and read all the .png and save and then go to the third subfolder etc. anyone can help me with it?
0 commentaires
Réponses (2)
Azzi Abdelmalek
le 26 Fév 2014
Modifié(e) : Azzi Abdelmalek
le 26 Fév 2014
folder='E:\matlab'
d=dir(folder)
subf=d([d.isdir])
im=[]
for k=3:numel(subf)
subfolder=subf(k).name
subf1=fullfile(folder,subfolder)
f=dir([subf1 '\*.png'])
for ii=1:numel(f)
file=fullfile(subf1,f(ii).name);
im{end+1}=imread(file);
end
end
im
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!