Get files in the current directory and child directories files dynamically
12 views (last 30 days)
Show older comments
This code example, I can only get the directory indicated:
nameDir = uigetdir();
listDir = strcat(nameDir, '/*.jpg');
myFiles = dir(listDir);
tam = length(myFiles);
path = cell(tam, 3);
for l = 1: tam
nameImg = myFiles(l, 1).name;
dateImg = myFiles(l, 1).date;
path{l, 1} = false;
path{l, 2} = fullfile(nameDir, nameImg);
path{l, 3} = dateImg;
set(handles.uitable1, 'ColumnWidth', {28, 375, 175}, 'Data', path);
end
What should I add
Thx since already!
0 Comments
Answers (1)
Image Analyst
on 30 Sep 2014
See my demo. It does exactly that - recurses into subfolders listing all the files.
0 Comments
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!