MATLAB: Error using imread>get_full_filename (line 566) File “PAT\NPatsmall\0.tif” does not exist.

file not existimread

good evening
i am new user for matlab so i try to collect images from many folder to get the DCT2, RGB histogram and indexed-color histogram features .
i got a error that file is not exist but i check it by my self it was there
i try to chang the file name but it make no diffrencese
this is the code
if any one can help
—————————————————————————-
ind=0;
path=strcat('PAT\', www ,'\');
outputfile2=strcat(www);
outputfileName2=strcat(path,outputfile2);
outputfileName3=strcat(outputfile2);
for iiii=1:50 %loop over the 100 images in each category
iii = (jndex-1)*50 + iiii -1;
fileName1=strcat(num2str(iii,'%2d'),'.tif');
outputfile1=strcat(num2str(iii,'%2d'),'.feats');
fileName1=strcat(path,fileName1);
outputfileName=strcat(path,outputfile1);
%reading the image:
X= imread(fileName1);
Xg=rgb2gray(X);
——————————————————————————

Best Answer

Hi Abdallah,
  1. All of your folders from which you are trying to get data/images are added to the search path of your matlab. If not, then you should add them, via the command: addpath()
  2. Make sure that your file names to be on a sequential order then your loop operation would work.
  3. Now your code is not complete yet.
Good luck.