animate

版本 1.1.0.0 (4.2 KB) 作者: Matthew Kelly
Real-time animation in Matlab, with keyboard call-backs
94.0 次下载
更新时间 2015/12/11

查看许可证

This function is called to generate an animation from data. The user passes time and state data as vectors, as well as function handle to draw the system. Animate will attempt to plot the system at the desired rate. Keyboard call-backs are provided to allow the user to pause the animation, speed-up or slow-down, jump forward or backward by a frame, or restart.
%animate(t,x,P)
%
%FUNCTION:
% Animate is used to animate a system with state x at the times in t.
%
%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
% .speed = scalar multiple of time, for playback speed
% .figNum = (optional) figure number for plotting. Default = 1000.
% .verbose = set to false to prevent printing details. Default = true;
%
%OUTPUTS:
% Animation based on data in t and x.
%
%NOTES:
%
% Keyboard commands during simulation:
%
% 'space' - toggle pause
%
% 'r' - reset animation
%
% 'uparrow' - go faster
%
% 'downarrow' - go slower
%
% 'rightarrow' - jump forward by 5 frames
%
% 'leftarrow' - jump backward by 5 frames
%
% 'esc' - quit animation
%
%

引用格式

Matthew Kelly (2024). animate (https://www.mathworks.com/matlabcentral/fileexchange/54427-animate), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2012a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Animation 的更多信息

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