User`s guide
Manual 2-D AVI Recording with MATLAB
4-19
Manual 2-D AVI Recording with MATLAB
This topic describes how to manually record a 2-D animation using the MATLAB
interface for a virtual world that is associated with a Simulink model. In this example,
the timing of the animation file derives from the simulation time. One second of the
recorded animation time corresponds to one second of Simulink time. You create and
record the animation file by interactively starting and stopping the recording from the
MATLAB Command Window.
This procedure uses the vrplanets example. It describes how to create an .avi
animation filename with the default name format.
1
Run the Simulink model for vrplanets. In the MATLAB window, type
vrplanets
The Simulink model appears. Also by default, the Simulink 3D Animation Viewer for
that model is loaded and becomes active. If the viewer does not appear, double-click
the Simulink® 3D Animation block in the Simulink model.
2
To work with the virtual world associated with vrplanets from the MATLAB
interface, retrieve the virtual world handle. Use the vrwhos command. Type
vrwhos
3
If the result indicates that only one vrworld object is in the workspace, assign its
handle directly to a variable. Type
myworld = vrwho;
If multiple virtual worlds are listed, you must select which of these virtual worlds
you want to manipulate. To select the virtual world, you can use indexing or a
selection method using a string comparison of virtual world descriptions. For the
indexing method, type
worlds = vrwho;
myworld = worlds(1);
For the string comparison method, type
worlds = vrwho;
myworld =
worlds(strcmp('Planets',get(worlds,'Description')));