How do I access a specific directory so I can then retrieve images in that directory with a specific file extension?
2 views (last 30 days)
Show older comments
How do I access a specific directory so I can then retrieve images in that directory with a specific file extension?
0 Comments
Answers (1)
Stephen23
on 9 Sep 2019
Edited: Stephen23
on 9 Sep 2019
D = 'relative or absolute path to the specific directory';
S = dir(fullfile(D,'*.png'));
C = {S.name} % output cell array
1 Comment
Walter Roberson
on 10 Sep 2019
C = fullfile(D, {S.name}); % output cell array
to get the fully-qualified names.
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!