States
Description
Saves states data to the specified variable in the MATLAB® workspace.
Category: Data Import/Export
Settings
Default: Off, xout
On
Log states data to the MATLAB workspace.
Specify the name of the variable used to store the logged states data. See Save Block States and Simulation Operating Points for more information.
Off
Do not log states data.
Tips
Specify the format for the logged states data using the Format parameter.
To log fixed-point states data, log states data using the
Dataset
format.When you log states data using the
Dataset
format, states data streams to the Simulation Data Inspector during simulation.Dataset
format does not support:Logging states during rapid accelerator simulation.
Logging states inside a function-call subsystem.
Code generation.
The states logging variable is empty when you enable states logging for a model that has no states.
If you log states data in a format other than
Dataset
, you can convert the logged data toDataset
format. Converting the data toDataset
makes it easier to post process with other logged data. For more information, see Dataset Conversion for Logged Data.If you log states data in
Structure with time
format or inArray
format while also logging time, select the Record logged workspace data in Simulation Data Inspector parameter to view the data in the Simulation Data Inspector after simulation.
Programmatic Use
Parameter:
SaveState |
Value:
'on' | 'off' |
Default:
'off' |
Parameter:
StateSaveName |
Type: character vector |
Default:
'xout' |
Recommended Settings
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No recommendation |
Safety precaution | No recommendation |