博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
write frames to a video
阅读量:4041 次
发布时间:2019-05-24

本文共 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

Properties

positive integer

P-by-3 numeric matrix

10 (default) | integer greater than 1

scalar value

'avi' | 'mp4' | 'mj2'

string

integer

30 (default) | positive number

scalar

true | false

integer in the range [1,16]

string

75 (default) | integer in the range [0,100]

numeric scalar

'None' | 'H.264' | 'Motion JPEG' | 'Motion JPEG 2000'

string

numeric scalar

转载地址:http://ivxdi.baihongyu.com/

你可能感兴趣的文章
Vue组件
查看>>
python_time模块
查看>>
python_configparser(解析ini)
查看>>
selenium学习资料
查看>>
<转>文档视图指针互获
查看>>
从mysql中 导出/导入表及数据
查看>>
HQL语句大全(转)
查看>>
几个常用的Javascript字符串处理函数 spilt(),join(),substring()和indexof()
查看>>
javascript传参字符串 与引号的嵌套调用
查看>>
swiper插件的的使用
查看>>
layui插件的使用
查看>>
JS牛客网编译环境的使用
查看>>
9、VUE面经
查看>>
关于进制转换的具体实现代码
查看>>
Golang 数据可视化利器 go-echarts ,实际使用
查看>>
mysql 跨机器查询,使用dblink
查看>>
mysql5.6.34 升级到mysql5.7.32
查看>>
dba 常用查询
查看>>
Oracle 异机恢复
查看>>
Oracle 12C DG 搭建(RAC-RAC/RAC-单机)
查看>>