How do I access images from directories using an input command for the extensive file?
Show older comments
I have a function which accesses images from a directory using inputs dirname and the filetype. When I type filenames = image(dirname,filetype), (e.g. filenames = image('/Users/Macbookair','jpg'), I can access all the files from the directory if the code has the line fileIdentity = fullfile(dirname, '*.jpg').
However, if I type in filenames = image('/Users/Macbookair','png'), the folders of jpg still appear in the command window. My question is how do I add an input command, such as filetype, so that whenever I type 'png', 'jpg' or any other extensive file it will show up as that specific file.
Thank you!
2 Comments
Walter Roberson
on 6 Sep 2019
Why did you name your function "image", when that is the name of a key matlab function for drawing images? imshow() and imagesc() also internally depend upon image() so by naming your function "image" you make it quite difficult to draw images.
Walter Roberson
on 6 Sep 2019
We do not know how your existing function accesses file names, which makes it difficult to know what to suggest.
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown 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!