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

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 1일
편집: Azzi Abdelmalek 2014년 2월 1일

0 개 추천

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

댓글 수: 6

romasha
romasha 2014년 2월 1일
how to fix this error?
Azzi Abdelmalek
Azzi Abdelmalek 2014년 2월 1일
post your code (the concerned part)
romasha
romasha 2014년 2월 1일
편집: Walter Roberson 2014년 2월 1일
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 2014년 2월 1일
편집: Azzi Abdelmalek 2014년 2월 1일
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 2014년 2월 1일
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 2014년 2월 1일
This is not clear

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2014년 2월 1일

1 개 추천

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

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

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

태그

질문:

2014년 2월 1일

댓글:

2014년 2월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by