Skip to Main Content Skip to Search
Product Documentation

Recording Animation

About Recording

As the SimMechanics visualization window displays the body motion, you can capture what you see as a recording and save it. This section explains how to record animations. See the preceding section, Controlling Animation, for more about animation.

How Recording Works

If you record an animation, the recording captures each updated, displayed simulation scene as a frame.

Whatever you see in the animated display window, is what the recording captures, as closely as it can within the limitations of the format.

Recording Animations

When you record an animation from the window, it is stored as a file on your system in Audio Video Interleave (AVI) format.

Activating and Controlling Animation Recording

Specifying the Name and folder of the Animation File

You can specify a location and name for your AVI file recording by selecting Choose AVI File Location from the Simulation menu. If you activate recording, an AVI File Location file browser opens and requires you to select a location and specify an AVI name. The default AVI name for a model called modelname.mdl is modelname.avi, but you can change this default name. Click Save to complete the AVI file specification.

When you activate recording, this AVI file name appears in the bottom middle of the full visualization window, below the display, in the status bar.

If you cancel the file browser, the recording is canceled as well.

How MATLAB Records the Animation

The simulation first records a MATLAB movie by capturing the display at every visualization sample time step. Then, in the termination phase of your simulation, it converts this movie to AVI format and stores it in the AVI file. A small AVI Conversion window opens to indicate that conversion and storage are complete and to display the path of the AVI file. Click OK to close this prompt.

Compressing Animation Recordings

You can reduce the size of your AVI file by compressing it. Select Compress AVI File to activate this feature. The default is active.

Support Restrictions for Recording Compression

AVI compression is available only on the Windows® platform. MATLAB uses the Indeo 5 compression algorithm. You must have the corresponding video codec installed to

Check your operating system configuration for installed video codecs.

Controlling the Size of the Recorded Animation

Any technique that reduces the number of visualization samplings and updates reduces the total stream of animated frames and the size of the recorded file. See Controlling Animation preceding.

Playing Recordings of Animation

You need an AVI-compatible video player to view the recorded file. You can use the internal MATLAB movie viewer or an external video player.

Matching Playback Speed to Simulation Speed

Your computer will play back an AVI animation recording at 15 frames per second of real (clock) time, regardless of the simulation speed or visualization sample time during recording.

To guarantee that the animation playback show the simulation in real (clock) time, before recording, set:

See Changing How the Animation Is Updated preceding for more about sample times.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS