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

 Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 1 Fév 2014
Modifié(e) : Azzi Abdelmalek le 1 Fév 2014

0 votes

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

6 commentaires

romasha
romasha le 1 Fév 2014
how to fix this error?
Azzi Abdelmalek
Azzi Abdelmalek le 1 Fév 2014
post your code (the concerned part)
romasha
romasha le 1 Fév 2014
Modifié(e) : Walter Roberson le 1 Fév 2014
imgNameList=char('images.jpg','images (1).jpg','images (2).jpg','download.jpg','images (4).jpg','images (5).jpg','images (6).jpg','images (7).jpg','eye3.jpg');
pause on;
for i=1:length(imgNameList)
a=imread(imgNameList(i,:));
imshow(a); drawnow; pause(2);
end
Azzi Abdelmalek
Azzi Abdelmalek le 1 Fév 2014
Modifié(e) : Azzi Abdelmalek le 1 Fév 2014
imgNameList should be a cell array
imgNameList={'images.jpg','images (1).jpg','images (2).jpg','download.jpg','images (4).jpg','images (5).jpg','images (6).jpg','images (7).jpg','eye3.jpg'}
To get each file use
imgNameList{i}
romasha
romasha le 1 Fév 2014
thanx but there is another problem when image get change gui figure loads every time which doesn't look nice how to solve this?
Azzi Abdelmalek
Azzi Abdelmalek le 1 Fév 2014
This is not clear

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 1 Fév 2014

1 vote

imgNameList = {'images.jpg','images (1).jpg','images (2).jpg','download.jpg','images (4).jpg','images (5).jpg','images (6).jpg','images (7).jpg','eye3.jpg'};
pause on;
for i = 1:length(imgNameList)
a = imread(imgNameList{i});
imshow(a); drawnow; pause(2);
end

2 commentaires

romasha
romasha le 1 Fév 2014
thanx :-)
romasha
romasha le 1 Fév 2014
thanx but there is another problem when image get change gui figure loads every time which doesn't look nice how to solve this?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange

Produits

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by