Web-browser viewable GUI animations of .PNGs, .GIFs, etc.
Updated 17 Apr 2017
Let's say you have 24 .png graphics files you have generated in Matlab. You would like to view them as an animation, so you convert them to a movie format like .avi or .mpeg, with each graphics file being a separate frame of the movie.
There are three problems with the resulting movie:
(1) You find you can't view it on certain platforms or without installing a particular piece of software; bewildering messages about "missing codecs" appear on your screen when you try to view the movie on a Linux machine.
(2) The movie file is HUGE, despite consisting of only 24 frames.
(3) The image quality is much worse than in the original graphics files.
jsanim.m has numerous options, but at its simplest, it can be called with the syntax:
where fileList is a cell array of filenames of image files. The resulting html file can be opened in a Web browser.
Kevin Bartlett (2023). Web-browser viewable GUI animations of .PNGs, .GIFs, etc. (https://www.mathworks.com/matlabcentral/fileexchange/36052-web-browser-viewable-gui-animations-of-pngs-gifs-etc), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
- MATLAB > Graphics > Printing and Saving >
- MATLAB > Graphics > 2-D and 3-D Plots > Animation >
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Calling syntax is somewhat different than for version 1; some input arguments are no longer accepted.
Bugfixes pointed out by TideMan. Now possible to change frameDelays and loopPauses from their default values.
Added some troubleshooting tips to the documentation.