Can i record a figure as it is being plotted so that i can send it as an email attachment and viewed by someone who does not have matlab?

8 次查看(过去 30 天)
Please do tell me whether this possible- or suggest the closest solution.

回答(1 个)

bio lim
bio lim 2015-7-13
Hello. You can save an animated figure using VideoWriter() function. For example ,
writerObj = VideoWriter('example.avi');
writerObj.FrameRate = 60;
open(writerObj);
Z = peaks; surf(Z);
axis tight
set(gca,'nextplot','replacechildren');
set(gcf,'Renderer','zbuffer');
for k = 1:20
surf(sin(2*pi*k/20)*Z,Z)
frame = getframe;
writeVideo(writerObj,frame);
end
close(writerObj);
The animated plot is saved as an .avi file.
  4 个评论
yashvin
yashvin 2015-7-15
I am capturing the frames during plotting. In fact, I am having lots of for loop which are generating plots. Can I force the frames to be the same size for all the plots?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Animation 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by