How do I access a specific directory so I can then retrieve images in that directory with a specific file extension?
1 次查看(过去 30 天)
显示 更早的评论
How do I access a specific directory so I can then retrieve images in that directory with a specific file extension?
0 个评论
回答(1 个)
Stephen23
2019-9-9
编辑:Stephen23
2019-9-9
D = 'relative or absolute path to the specific directory';
S = dir(fullfile(D,'*.png'));
C = {S.name} % output cell array
1 个评论
Walter Roberson
2019-9-10
C = fullfile(D, {S.name}); % output cell array
to get the fully-qualified names.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!