Get files in the current directory and child directories files dynamically

17 次查看(过去 30 天)
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!

回答(1 个)

Image Analyst
Image Analyst 2014-9-30
See my demo. It does exactly that - recurses into subfolders listing all the files.

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by