필터 지우기
필터 지우기

What variables should i choose inside the loop?

조회 수: 2 (최근 30일)
peyush
peyush 2015년 7월 24일
댓글: peyush 2015년 7월 25일
Suppose I have NN number of images named img1 to imgNN...what variables should I choose to display all the images inside the loop..
NN = 40;
for ii = 1:NN
figure;
imshow(img(NN));
axis on;
end
I tried this but its not working...I am facing trouble choosing the variable..any help is appreciated

채택된 답변

Walter Roberson
Walter Roberson 2015년 7월 24일
편집: Walter Roberson 2015년 7월 24일
NN = 40;
for ii = 1:NN
figure;
thisimgname = sprintf('img%d.jpg', ii);
img = imread(thisimgname);
imshow(img);
axis on;
end

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by