Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MATLAB Saving multiple figures to a PDF

Tags:

matlab

Is there any way to do this?

I know how to use saveas (saveas(1, filename, 'pdf');) to save one figure to a PDF file, but is it possible to add multiples? So something like (saveas(1,2,3) filename, 'pdf'));.

Thanks

like image 712
Mark Hughes Avatar asked Jan 07 '13 01:01

Mark Hughes


1 Answers

I don't think so - you need to increment the file name in some manner. I would use something like:

for ii=1:3
    saveas(ii,[filename '-' num2str(ii)],'pdf)
end

As a side note, I have had repeated difficulties when including the pdfs generated by matlab in a manuscript submission. My current solution is to produce eps files and convert with a shell script.

r/

like image 144
drb Avatar answered Sep 20 '22 22:09

drb