how to pass image name dynamically

In my code there is 'for loop' and i have to pass image name according to loo
if true
% code
for k=100 to 102
imshow('C:\Users\shraddha\Documents\MATLAB\Snaps\100.png');
end
at '100.png' I want the value of k so i tried a lot but didn't got the solution..please sugest me some solution.

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 23 Nov. 2014

0 Stimmen

for k=100 to 102
imshow(sprintf('C:\Users\shraddha\Documents\MATLAB\Snaps\%d.png',k));
end

1 Kommentar

Shraddha Agnihotri
Shraddha Agnihotri am 23 Nov. 2014
This still showing error like...
Error in imshow (line 198) [common_args,specific_args] = ...
Error in roi_demo (line 31) imshow(sprintf('C:\Users\shraddha\Documents\MATLAB\Snaps\%d.png',k)) >>

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Convert Image Type finden Sie in Hilfe-Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by