What variables should i choose inside the loop?

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

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 24 Jul. 2015
Bearbeitet: Walter Roberson am 24 Jul. 2015

0 Stimmen

NN = 40;
for ii = 1:NN
figure;
thisimgname = sprintf('img%d.jpg', ii);
img = imread(thisimgname);
imshow(img);
axis on;
end

Weitere Antworten (0)

Kategorien

Mehr zu Images finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 24 Jul. 2015

Kommentiert:

am 25 Jul. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by