How to save save split images in multiple filenames?
Mostrar comentarios más antiguos
I have a code which shows the multiple images of a scanned *.tif document.
for i=1:5
d=imshow(imread('gi2.tif',i));
figure;
end
I need to save these images as multiple files. I used the following code for that:
basename='im_'
for i=1:5
d=imshow(imread('gi2.tif',i));
figure;
filename=[basename,num2str(i)];
end
But the code is just creating a variable filename with data im_5. I also tried using "sprintf" using the following code:
for i=1:5
d=imread('gi2.tif',i));
filename=sprintf('im_%d.jpg',i)
end
But this basically prints the filename im_<no.> and nothing else.
Please support!!
Respuesta aceptada
Más respuestas (0)
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!