MATLAB: How to resolve this error

imagesMATLAB

a=imread(imgNameList(i,:));
>> slideshow Index exceeds matrix dimensions.
Error in slideshow (line 14) a=imread(imgNameList(i,:));

Best Answer

That means the value of i exceeds the number of element in imgNameList . you can check it by typing
size(imgNameList)
disp(i)