Set Simulink Based State Properties

To model systems that switch between periodic or continuous time dynamics, use Simulink® based states. Simulink based states are supported only in Stateflow® charts in a Simulink model. For more information, see Simulink Subsystems as States.

Set and modify the properties of a Simulink based state in the Property Inspector or in a Simulink based state properties dialog box.

For a Simulink based state, you can set these properties.

Simulink Based State PropertiesDescription
Create data for monitoring self activityCreates a data output port on the Stateflow block for this self-activity of the state.
Log self activityLogs the state self-activity. View the activity of the state in the Simulation Data Inspector.
Logging nameSpecify the signal logging name. To create a signal logging name that is different from the state name, choose Custom, and add the name.
Limit data points to lastMaximum number of data points to log. Default value is 5000, which means the chart logs the last 5000 data points generated by the simulation.
DecimationDecimation interval limits the amount of data logged by skipping samples. Default value is 2, which means the chart logs every other sample.
Test point

Sets the Simulink based state as a Stateflow test point. See Monitor Test Points in Stateflow Charts.

Function packaging

Specify the code format generated for a Simulink based state. You can set the format to one of these options:

  • AutoSimulink Coder™ software chooses the optimal format for you based on the type and number of instances of the subsystem that exist in the model.

  • InlineSimulink Coder software inlines the subsystem unconditionally.

  • Nonreusable functionSimulink Coder software explicitly generates a separate function in a separate file.

  • Reusable functionSimulink Coder software generates a function with arguments that allows reuse of Simulink based state code when a model includes multiple instances of the Simulink based state.

See Function packaging (Simulink).

Related Topics