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!
Best Answer