How do I access images from directories using an input command for the extensive file?
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 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
le 6 Sep 2019
We do not know how your existing function accesses file names, which makes it difficult to know what to suggest.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!