how to index output figures
Show older comments
Hi, I am working with jpeg pictures when I'm editing them in a cycle. And I'd like to create output something like 'Pic_1.jpg', 'Pic_2.jpg',... depending on number of iteration. So I wanto to ask you how to create figures with variable index. Thanks
Answers (2)
Azzi Abdelmalek
on 10 May 2014
k=2
f=sprintf('Pic_%d.jpg',k)
Image Analyst
on 10 May 2014
0 votes
See the FAQ : http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions., which basically recommends to use export_fig to save your figures or axes as picture files.
Then put export_fig into a loop like is in the FAQ:
which shows you how to create a filename based on the iteration variable.
Categories
Find more on Display Image in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!