Using Simulink Previous page   Next Page

Using the sim Command

The full syntax of the command that runs the simulation is

Only the model parameter is required. Parameters not supplied on the command are taken from the Configuration Parameters dialog box settings.

For detailed syntax for the sim command, see the documentation for the sim command. The options parameter is a structure that supplies additional configuration parameters, including the solver name and error tolerances. You define parameters in the options structure using the simset command (see simset). The configuration parameters are discussed in Configuration Sets.

Using the set_param Command

You can use the set_param command to start, stop, pause, or continue a simulation, or update a block diagram. The format of the set_param command for this use is

where 'sys' is the name of the system and 'cmd' is 'start', 'stop', 'pause', 'continue', or 'update'.

Similarly, you can use the get_param command to check the status of a simulation. The format of the get_param command for this use is

Simulink returns 'stopped', 'initializing', 'running', 'paused', 'updating', 'terminating', and 'external' (used with Real-Time Workshop).


Previous page  Running a Simulation Programmatically Analyzing Simulation Results Next page

© 1994-2005 The MathWorks, Inc.