本文共 1047 字,大约阅读时间需要 3 分钟。
%# figurefigure, set(gcf, 'Color','white')Z = peaks; surf(Z); axis tightset(gca, 'nextplot','replacechildren', 'Visible','off');[az,el]=view;xl=xlim;yl=ylim;zl=zlim;%# preallocatenFrames = 20;mov(1:nFrames) = struct('cdata',[], 'colormap',[]);%# create moviefor k=1:nFrames view([(az-k*10) el]); xlim(xl);ylim(yl);zlim(zl); drawnow;pause(0.1); mov(k) = getframe(gcf);endclose(gcf)%# save as AVI file, and open it using system video player%writeVideo(mov, 'myPeaks1.avi', 'compression','None', 'fps',10);v = VideoWriter('myPeaks1.avi','Uncompressed AVI');v.FrameRate = 10;open(v);writeVideo(v,mov)close(v);
要设置 video的一些属性请看https://uk.mathworks.com/help/matlab/ref/videowriter.html
转载地址:http://ivxdi.baihongyu.com/