Main Content

Set Simulink Based State Properties

Simulink® based states are Simulink subsystems within a Stateflow® state that enable you to model systems that switch between periodic or continuous time dynamics. For more information, see Simulink Subsystems as States.

You can specify the properties of a Simulink based state in either the Property Inspector or the properties dialog box for the Simulink based state.

  • To use the Property Inspector:

    1. In the Modeling tab, under Design Data, select Property Inspector.

    2. In the Stateflow Editor, select the Simulink based state.

    3. In the Property Inspector pane, edit the properties of the Simulink based state.

  • To use the Simulink Based State properties dialog box:

    1. In the Stateflow Editor, right-click the Simulink based state.

    2. Select Properties.

    3. Edit the Simulink based state properties.

You can also specify Simulink based state properties programmatically by using Stateflow.SimulinkBasedState objects. For more information about the Stateflow programmatic interface, see Overview of the Stateflow API.

Simulink Based State Properties

You can set the following chart properties in the Properties and Info tabs of the Property Inspector and the Simulink Based State properties dialog box.

Create data for monitoring self activity

Creates a data output port on the Stateflow block for this self-activity of the state.

Log self activity

Logs the state self-activity. View the activity of the state in the Simulation Data Inspector.

Logging name

Specify the signal logging name. To create a signal logging name that is different from the state name, choose Custom, and add the name.

Test point

Sets the Simulink based state as a Stateflow test point. For more information, see Monitor Test Points in Stateflow Charts.

Limit data points to last

Maximum number of data points to log. Default value is 5000, which means the chart logs the last 5000 data points generated by the simulation.

Decimation

Decimation interval limits the amount of data logged by skipping samples. Default value is 2, which means the chart logs every other sample.

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.

For more information, see Function packaging (Simulink).

Description

Simulink based state description. You can enter brief descriptions of Simulink based states in the hierarchy.

Document Link

Link to online documentation for the Simulink based state. You can enter a web URL address or a MATLAB® command that displays documentation in a suitable online format, such as an HTML file or text in the MATLAB Command Window. When you click the Document link hyperlink, Stateflow displays the documentation.

Related Topics