fileFolder = fullfile('E:\tom\mat');
dirOutput = dir(fullfile(fileFolder,'image*.jpg'));
fileNames = {dirOutput.name}'
I = imread(fileNames{1});
imshow(I);
出现了这样的错误:
Error using imread
File "exp.jpg" does not exist.

imread出错这是怎么回事啊,
- 写回答
- 好问题 0 提建议
- 关注问题
- 邀请回答
-
3条回答 默认 最新
- 凌_2016 2016-06-07 00:53关注
正确的表达应该是这样的吧
I = imread(fullfile(fileFolder,fileNames{1}));
参考文章:(英文)
http://blogs.mathworks.com/steve/2011/12/23/batch-processing-files-in-another-folder/?s_tid=blog_steve_category
http://mathforum.org/kb/thread.jspa?messageID=7003882&threadID=2050246本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报