save images inside for loop
Mostrar comentarios más antiguos
In the below for loop, i runs from 1 3 5 7 ....100. But I would like to save images Y1.bmp, Y2.bmp, Y3. bmp .... instead of Y1.bmp, Y3.bmp, Y5. bmp. Is there any way to implement this in the below for loop
for i = 1:2:100
%% operation %%
saveas(gcf,sprintf('Y_%d.bmp',i))
end
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 22 de Oct. de 2024
for i = 1:2:100
%% operation %%
saveas(gcf,sprintf('Y_%d.bmp',(i+1)/2))
end
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!