Error using imread (line 368) ; File "..." does not exist
3 次查看(过去 30 天)
显示 更早的评论
Hi all, I am getting this error , can please any tell what I am doing wrong, as file do exists.
myFolder = 'C:\Users\Ankit Gupta\Desktop\image\'; if ~isdir(myFolder) errorMessage = sprintf('Error: The following folder does not exist:\n%s', myFolder); uiwait(warndlg(errorMessage)); return; end filePattern = fullfile(myFolder, '*.png'); pngfiles = dir(filePattern); >> im1 = imread(pngfiles(1).name) Error using imread (line 368)
0 个评论
采纳的回答
Iman Ansari
2013-5-3
Hi. change your current folder to myFolder:
cd(myFolder)
or use this:
im1 = imread([myFolder pngfiles(1).name])
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Filtering and Enhancement 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!