You'll want to do it in a loop. First, make sure you have stored the handles to your figures in a vector.
figures = [];
% Generate figures
%[your code]
% Resize and output figures
figSize = [21, 29]; % [width, height]
figUnits = 'Centimeters';
for f = 1:numel(figures)
fig = figures[f];
% Resize the figure
set(fig, 'Units', figUnits);
pos = get(fig, 'Position');
pos = [pos(1), pos(4)+figSize(2), pos(3)+figSize(1), pos(4)];
set(fig, 'Position', pos);
% Output the figure
filename = sprintf('Figure%02d.pdf', f);
print( fig, '-dpdf', filename );
end
You can read more about the print command here:
doc print
