Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- figure % 创建图窗
- myVideo=VideoWriter('VideoFile_test'); % 指定视频文件名
- open(myVideo) % open开始写入
- myVideo.FrameRate=30; %调整视频帧率
- x=0:0.01:2*pi; % 函数曲线绘图范围
- for i=1:100
- plot(x,sin(x+i/100*2*pi),'LineWidth',2);
- drawnow % 即时显示当前图窗
- Fr=getframe(gcf); % 抓取图窗
- writeVideo(myVideo,Fr); % 写入文件
- end
- close(myVideo) % close文件,结束
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement