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 Use Model Operating Point for Faster Simulation Workflow.See Save Block States and Simulation Operating Points for more information.
If you use a format other than
Dataset
, you can convert the logged data toDataset
format. Converting the data toDataset
makes it easier to postprocess with other logged data. For more information, see Dataset Conversion for Logged Data.
Programmatic Use
Parameter:
SaveFinalState |
Value:
'on' | 'off' |
Default:
'off' |
Parameter:
FinalStateName |
Type: character vector |
Default:
'xFinal' |
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No recommendation |
Safety precaution | No recommendation |