The error is due to the input argument provided to the “imread” function. The input “pngfiles(i).name” which is equal to
“100_nouvel-obs_hbhnr300_constructedPdf_Nouvelobs2402PDF.clean.png'’ (for i=1 in your case) is not the complete path of the PNG image file you are trying to load.
It can work only in the following scenarios :
- The files are in the MATLAB’s path
- Or the current working directory contains the files which you are loading.
In all other cases provide the complete path of the image file to the “imread” function’s argument. ('G:\Matlab Code-IIITA\DATASETS\nouvel_obs_2402_clean-1.0\input\100_nouvel-obs_hbhnr300_constructedPdf_Nouvelobs2402PDF.clean.png')