Saving figures in batch mode

15 views (last 30 days)
Guillermo Aldana
Guillermo Aldana on 19 Jul 2014
I have code that generates n number of images (figures). I would like to know if matlab has a command that SAVES ALL figures into predetermined folder, wight the user's specified format (.fig, .pdf, .tiff). I have been out of scientific programing for a while, so this may be a new feature that you have, that I am not aware of, so please forgive me if what I am asking for is a matlab commodity by now.
G

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 19 Jul 2014
h=findobj('type','figure') % find the handles of the opened figures
folder='E:' % Desination folder
for k=1:numel(h)
filename=sprintf('image%d.jpg',k)
file=fullfile(folder,filename)
saveas(h(k),file)
end
  2 Comments
Azzi Abdelmalek
Azzi Abdelmalek on 19 Jul 2014
Guillermo commented
Thank you Azzi - I am not familiar with "handles" as it pertains to what they do, how to use them for diff. circumstances - do you have some reading material that would clarify EXACTLY what they are used for? thanks,

Sign in to comment.

Categories

Find more on App Building 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!