saveAnimation(t,x,P​)

版本 1.1.0.0 (1.3 KB) 作者: Matthew Kelly
Generate and save animation as video file
74.0 次下载
更新时间 2015/12/11

查看许可证

The user passes time and state data to the function, as well as a handle for plotting the system at a single state and time. SaveAnimation then marches through time at the desired frame rate, generating a mp4 animation as it goes.
%saveAnimation(t,x,P)
%
%FUNCTION:
% saveAnimation creates a mp4 video file, given data and a draw function.
%
%INPUTS:
% t = [1xM] vector of times, Must be monotonic: t(k) < t(k+1)
% x = [NxM] matrix of states, corresponding to times in t
% P = animation parameter struct, with fields:
% .plotFunc = @(t,x) = function handle to create a plot
% t = a scalar time
% x = [Nx1] state vector
% .figNum = (optional) figure number for plotting. Default = 1000.
% .frameRate = desired frame rate for the animation (real time)
% .fileName = desired file name (do not include extension)
%
%OUTPUTS:
% Animation file based on data in t and x.
%
%NOTES:
%
% The animation works by looping through every element in the input
% matricies, assuming that they are being presented at the desired frame
% rate.
%

引用格式

Matthew Kelly (2024). saveAnimation(t,x,P) (https://www.mathworks.com/matlabcentral/fileexchange/54436-saveanimation-t-x-p), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2015a
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Improved description.

1.0.0.0