Using Simulink Previous page   Next Page

Importing and Exporting States

Initial conditions, which are applied to the system at the start of the simulation, are generally set in the blocks. You can override initial conditions set in the blocks by specifying them in the Initial state field of the Load from workspace area of the Data Import/Export pane.

You can also save the final states for the current simulation run and apply them to a subsequent simulation run. This feature can be useful when you want to save a steady-state solution and restart the simulation at that known state. The states are saved in the format that you select in the Save options area of the Data Import/Export pane.

Saving Final States

To save the final states (the values of the states at the termination of the simulation), select the Final states check box and enter a variable in the adjacent edit field.

Loading Initial States

To load states, select the Initial state check box and specify the name of a variable that contains the initial state values. This variable can be a matrix or a structure of the same form as is used to save final states. This allows Simulink to set the initial states for the current session to the final states saved in a previous session, using the Structure or Structure with time format.

Model Reference Limitations On Loading Initial States.   Simulink imposes the following limitations on loading the states of models that reference other models or that are referenced by other models.


Previous page  Exporting Output Data to the MATLAB Workspace Limiting Output Next page

© 1994-2005 The MathWorks, Inc.