Development Environment    

Exporting MATLAB Graphs in AVI Format

In MATLAB, you can save a sequence of graphs as a movie that can then be played back using the movie function. You can export a MATLAB movie by saving it in MAT-file format, like any other MATLAB workspace variable. However, anyone who wants to view your movie must have MATLAB. (For more information about MATLAB movies, see the Animation section in the MATLAB Graphics documentation.)

To export a sequence of MATLAB graphs in a format that does not require MATLAB for viewing, save the figures in Audio Video Interleaved (AVI) format. AVI is a file format that allows animation and video clips to be played on a PC running Windows or on UNIX systems.

Creating an AVI Format Movie

To export a sequence of MATLAB graphs as an AVI format movie, perform these steps:

  1. Create an AVI file, using the avifile function.
  2. Capture the sequence of graphs and put them into the AVI file, using the addframe function.
  3. Close the AVI file, using the close function, overloaded for AVI files.

For example, this code example exports a sequence of MATLAB graphs as the AVI file mymovie.avi.

Note the following items in this code example:


  Exporting Binary Data Importing HDF Data