No BSD License  

Highlights from

4.8 | 18 ratings Rate this file 23 Downloads (last 30 days) File Size: 2.02 MB File ID: #18210 Version: 1.0
image thumbnail



Jerker Wagberg (view profile)


03 Jan 2008 (Updated )

Animate Handle Graphics objects

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

ANYMATE can be used to easily animate Matlab plots. It is very general and is not limited to any specific plot type or specific object. Given a plot function and some data, a useful animation can often be accomplished with just a single line of code. It is also possible to create an animation from existing figures.

The generated animations are not Matlab movies, but are instead real Handle Graphics objects, having the capability to change their appearences in real time. The changes are performed in the background and any Matlab command can be entered while an animation is active, including changing the properties of an animated object.

Plots can be zoomed, panned and rotated while the animation is running.

Animations can be saved as normal .fig files and started immediately, just by opening the file. Animations can also be saved as GIF, AVI and WMV files.

For more information and examples, see the attached HTML file, which, by the way, is the reason for the heavy download size, since the HTML contains animated GIF files.

The author wishes to thank John D'Errico for beta-testing ANYMATE, making sure that ANYMATE also works on a Mac.

MATLAB release MATLAB 7.5 (R2007b)
Other requirements Should work down to 7.1 (R14SP3). Send bug reports directly to user by email.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (20)
08 Oct 2014 Amr AbdelAty  
23 Dec 2013 Brett Shoelson

Brett Shoelson (view profile)

Jerker, This is a valuable addition to the File Exchange. It needs some updating, though.... I hope you'll consider replacing deprecated functionality to render it useful in current versions of MATLAB.

Comment only
18 Dec 2013 arnold

arnold (view profile)

great stuff. I just wish that I could still use the export function, it doesn't seem to work with windows 7 anymore.
Warning: AVIFILE will be removed in a future release. Use
> In avifile.avifile at 81
In anymate>AnimateToFile at 2003
In anymate>animation/ButtonSave at 1487
Warning: File 't1.818470283028525e-01.avi' not found.
> In anymate>animation/ButtonSave at 1495
Error using avifile (line 175)
Indeo codecs are not supported in this version of Windows.
Please specify a different codec.
See Mathworks Technical Solution 1-4G50RI for more

Error in avifile (line 175)

Error in anymate>AnimateToFile (line 2003)
avi=avifile(fn, 'compression',
anigetpref('AviCompression'), 'fps',

Error in anymate>animation/ButtonSave (line 1487)

Error while evaluating uipushtool ClickedCallback

Maybe you can update this to support more modern codecs, it would be highly appreciated!

23 Oct 2012 Evgeny Pr

Evgeny Pr (view profile)

23 Oct 2012 Evgeny Pr

Evgeny Pr (view profile)

23 Apr 2012 Kelly Kearney

Kelly Kearney (view profile)

I've been having some difficulty with this function when trying to animate figures that include a large mix of object types, particularly ones with the same "type" value but different properties. For example, lines produced by line vs plot, hggroup objects of different types, etc. Anymate fails when trying to gather properties of these due to its reliance on a single sample handle from each type. An easy fix (or at least, easier than trying to handle every property gracefully) would be to have a switch to exclude certain properties from being collected (right now, excluding from anymation doesn't exclude from collection).

Comment only
23 Mar 2012 Rolando


11 Aug 2011 Ben

Ben (view profile)

A great function worthy 5 stars!

19 Mar 2010 Javier Lopez-Calderon


03 Oct 2009 Bolu Ajiboye

Bolu Ajiboye (view profile)

This is an excellent submission. I wish i could give it 4.5 stars. Sorry to be the only one not to go for 5, but i have some issues, namely that some figures seem to get distorted when applied to anymate. Also, when you set the runmode and method from the function call, anymate doesnt seem to remember it. You have to do it again from the toolbar. Dont get me wrong, i love this function. It is one of the best i have seen on fileexchange, but some things dont work (for me anyways) as described.

29 Sep 2009 Chamane

Very helpfull

25 Jun 2009 Emanuele Ruffaldi  
03 Feb 2009 Husam Aldahiyat

Love this!

04 Nov 2008 Andres

Andres (view profile)

What else to add, other than 5 stars? Helpful author, great idea, brilliant implementation, has proven usefulness many times... Thanks!

03 Oct 2008 F Trintchouk

Very general, well thought out, robust and intuitive. Thank you!

08 May 2008 Johannes Korsawe

This is a really, really ingenious submission.
Easy to handle, great options, excellent results.
Thank you for sharing this great job.

08 Apr 2008 Gus Brown

This is really good, and it is ideal for Matlab beginners as it makes efficient animations very easy to create.

09 Jan 2008 Kelly Kearney

This is a great tool. Well documented and easy to use. Very helpful when trying to visualize a large number of model runs with varying parameters.

04 Jan 2008 Jiro Doke

Very nice! Here are a few things that I really like about this submission:
1. It interpolates (can choose between linear and spline-like) between "frames", which allows you to animate through only a few frames with transition. It works with images too.
2. It's a "mode" within a figure, so the interactive tools (zoom, pan) are still accessible.
3. Nice toolbar control buttons.
4. Good documentation. The published HTML files is very informative.
5. Can export to animated GIF or AVI.

04 Jan 2008 John D'Errico

NIFTY. Ok, maybe this comment shows my age, but it definitely applies. Its well done in all respects. Everything I tried worked. Animations were simple to build.

I did manage to crash Matlab after too many animations. This was probably a Matlab/Java version bug, maybe even Mac related, probably memory related.

Well done.

07 Jan 2008

Editorial changes to description. No changes to code.

09 Jan 2008

Titlebar could become invisible when the animation toolbar was added. Fixed.

11 Feb 2008

Fixed mangled argument passing. Did not work for ticks and/or tick-labels on command line.

Contact us