Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

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

Asked by Ankit Gupta on 3 May 2013

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 Comments

Ankit Gupta

Tags

Products

No products are associated with this question.

1 Answer

Answer by Iman Ansari on 3 May 2013
Accepted answer

Hi. change your current folder to myFolder:

cd(myFolder)

or use this:

im1 = imread([myFolder pngfiles(1).name])

0 Comments

Iman Ansari

Contact us