| Simulink Reference | ![]() |
Execute a particular phase of the simulation of a model
Syntax
[sys,x0,str,ts] = model([],[],[],'sizes'); [sys,x0,str,ts] = model([],[],[],'compile'); outputs = model(t,x,u,'outputs'); derivs = model(t,x,u,'derivs'); dstates = model(t,x,u,'update'); model([],[],[],'term');
Description
The model command executes a specific phase of the simulation of a Simulink model whose name is model. The command's last (flag) argument specifies the phase of the simulation to be executed. See Simulating Dynamic Systems for a description of the steps that Simulink uses to simulate a model.
This command is intended to allow linear analysis and other M-file program-based tools to run a simulation step by step, gathering information about the model's states and outputs at each step. It is not intended to be used to run a model step by step, for example, to debug a model. Use the Simulink debugger if you need to examine intermediate results to debug a model.
Arguments
Examples
This command executes the compilation phase of the vdp model that comes with Simulink.
The following command terminates the simulation initiated in the previous example.
Note
You must always terminate simulation of the model by invoking the model command with the 'term' command. Simulink does not let you close the model until you have terminated the simulation.
|
See Also
| add_exec_event_listener | sim | ![]() |
© 1994-2005 The MathWorks, Inc.