Error using imread (line 368) ; File "..." does not exist

7 ビュー (過去 30 日間)
Ankit Gupta
Ankit Gupta 2013 年 5 月 3 日
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)

採用された回答

Iman Ansari
Iman Ansari 2013 年 5 月 3 日
Hi. change your current folder to myFolder:
cd(myFolder)
or use this:
im1 = imread([myFolder pngfiles(1).name])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by