how i print figure in a loop?

i made a pcolor figure animation using a loop. i want to print each figure as jpg file. please help me
code: clc; clear; load('SSHA_all_199301-201202.mat') lon=SSHA.lon; lat=SSHA.lat; time=SSHA.time; ssha=SSHA.data;
[x y]=meshgrid(lon,lat); str=datestr(time,'mm-yyyy');
for n=1:length(time)
pcolor(x,y,ssha(:,:,n));
shading interp
colorbar
caxis([-40 40])
title(str(n,:))
pause(0.01)
end

Categories

Asked:

on 9 Jun 2015

Commented:

on 9 Jun 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!