ANIMATOR - animate data

This GUI tool allows you to animate your data with controls for playback speed and looping.
6.5K Downloads
Updated 1 Sep 2016

View License

Editor's Note: This was a File Exchange Pick of the Week

This GUI tool allows you to animate your data with controls for playback speed and looping.
The controls allows you to speed up and slow down (or reverse) the playback. You can pause at any time. You can also drag the time line bar to go to arbitrary frames. Also, use the arrow keys to move between frames (left or right) or change the speed (up or down). Spacebar pauses/starts the animation. In addition to the animation speed, the animation frame interval rate can be set from the menu.

The graphics properties can be customized via a context menu on the objects. Right-click on the plotted lines to bring up the context menu.

The animation can be exported to an AVI or an Animated GIF (from the menu).

ANIMATOR(X, Y) animates the data. The data has to be in one of the following formats. The general form is a 3-D array. 1st dimension is the numbe of elements in a signal (m). 2nd dimension is the number of lines (n). 3rd dimension is the number of frames (p).

ANIMATOR(X, Y, PARAM1, VALUE1, ...) accepts additional arguments:
'axis' : {'auto'}, 'equal
'xlim' : 'auto', [XMIN, XMAX].
'ylim' : 'auto', [YMIN, YMAX].
'title' : <title text>
'xlabel': <xlabel text>
'ylabel': <ylabel text>
'smooth': {'off'}, 'on'. Anti-aliasing

Example:
x = (0:.01:10)';
y = nan(length(x), 2, 400);
for idx = 1:400;
y(:,1,idx)=sin(2*x)+cos(0.25*sqrt(idx)*x);
y(:,2,idx)=-cos(0.7*x)+sin(0.4*sqrt(idx)*x);
end
animator(x, y);

*NOTE 1* This uses the new MATLAB Class System, so it requires R2008a or newer.
*NOTE 2* Requires R2010b or newer to export to an AVI.
*NOTE 3* Requires Image Processing Toolbox to export to Animated GIF, if using R2008b or older. If you're not going to export to Animated GIF, you don't need Image Processing Toolbox.

Cite As

Jiro Doke (2024). ANIMATOR - animate data (https://www.mathworks.com/matlabcentral/fileexchange/16037-animator-animate-data), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Animation in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.2.0.1

Updated license

1.2.0.0

Updated to include an App file for R2012b.

1.1.0.0

Changed the implementation to use MATLAB classes. Added the ability to bring in data from the base workspace. Added the ability to interactively change the graphics properties via context menu.

1.0.0.0

Added capability to export to AVI and animated GIF (R14SP2 or later)