File Exchange Pick of the Week

Our best user submissions

Web browser viewable animations 2

Posted by Jiro Doke,

Jiro's pick this week is Web-browser viewable animations by Kevin Bartlett.

I love thinking about creative ways of presenting results. As the number of dimensions increases, I find myself using animation as a way to convey one of the dimensions, oftentimes time. In MATLAB, it's easy to make animations, but when I need to visualize data on a website, I have to get creative. The description Kevin has on his entry page accurately explains the kinds of things I need to be concerned about when creating animations for web pages. To summarize,

  • Movie files may not play well in some platforms without an appropriate software.
  • Movie files tend to be large, especially when you try to make them cross-platform.
  • The image quality may suffer due to video compression.

For these reasons, I often create animated GIF's from my MATLAB visualizations. You can create animated GIF's using the imwrite function. However, Kevin introduces a more elegant, versatile approach of using Javascript to build and incorporate speed and play controls into your animations.

Click on the image below to see an example of a Javascript animation page.

His function has many options to customize the animation and the webpage, including frame delay controls. He provides plenty of documentation and examples to help you use his function.


Give this a try and let us know what you think here or leave a comment for Kevin.

Get the MATLAB code

Published with MATLAB® R2013b


Comments are closed.

2 CommentsOldest to Newest

Jason Schmidt replied on : 1 of 2
I have had many past and present coworkers making AVI files to embed in PowerPoint slides. Those always seemed buggy and not very portable, so animated GIFs might be a good alternative. A student of mine got me started making animated SWF files using Matlab and SWFTools ( SWF files use vector graphics, so they usually are much smaller files than their AVI counterparts. SWF files work nicely in either LaTeX slides or PowerPoint.
_____ __ replied on : 2 of 2
Hi there! This post couldn't be written much better! Looking through this article reminds me of my previous roommate! He always kept preaching about this. I most certainly will send this post to him. Fairly certain he's going to have a good read. I appreciate you for sharing!