Final states

Description

Saves the logged states of the model at the end of a simulation to the specified MATLAB® variable.

Category: Data Import/Export

Settings

Default: Off, xFinal

On

Simulink® software exports final logged state data to the MATLAB workspace during simulation.

Specify the name of the MATLAB variable in which to store the values of these final states. See Importing and Exporting States for more information.

Off

Simulink software does not export the final state data during simulation.

Tips

  • You must select the Final states check box before entering the final states variable.

  • Simulink software saves the final states in a MATLAB workspace variable having the specified name.

  • The saved data has the format that you specify with the Format parameter.

  • Simulink creates empty variables for final state logging (xfinal) if both of these conditions apply:

    • You enable Final states.

    • A model has no states.

  • Using the Final states is not always sufficient for complete and accurate restoration of a simulation state. The ModelOperatingPoint object contains the set of all variables that are related to the simulation of a model. For details, see Save complete SimState in final state and Save and Restore Simulation Operating Point.

  • See State Information for more information.

  • If you use a format other than Dataset, you can convert the logged data to Dataset format. Converting the data to Dataset makes it easier to postprocess with other logged data. For more information, see Dataset Conversion for Logged Data.

Command-Line Information

Parameter: SaveFinalState
Value: 'on' | 'off'
Default: 'off'
Parameter: FinalStateName
Type: character vector
Value: any valid value
Default: 'xFinal'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo recommendation
Safety precautionNo recommendation

Related Topics