截图当前窗口的20帧动画
图
代码
close all
figure('toolbar','none','menubar','none','NumberTitle','off','name','电影动画录制——matlabfan');
axis equal
m=moviein(20,gcf);%在当前窗口下,截取20帧
set(gca,'nextplot','replacechildren','box','off','color','b','xgrid','on')
title('截图当前窗口的20帧动画')
for j=1:20
plot(fft(eye(j+16)))
m(:,j)=getframe(gcf); %截取动画帧,保存到m变量中
end
hh=figure('toolbar','none','menubar','none','NumberTitle','off','name','电影动画播放——matlabfan');
title('将截取的动画播放5遍')
set(gca,{'xtick','ytick','xticklabel','yticklabel'},{[],[],[],[]})
movie(hh,m,5)
nxffm