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:
In the Modeling tab, under Design Data, select Property Inspector.
In the Stateflow Editor, select the Simulink based state.
In the Property Inspector pane, edit the properties of the Simulink based state.
To use the Simulink Based State properties dialog box:
In the Stateflow Editor, right-click the Simulink based state.
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.
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.
Creates a data output port on the Stateflow block for this self-activity of the state.
Logs the state self-activity. View the activity of the state in the Simulation Data Inspector.
Specify the signal logging name. To create a signal logging name that is
different from the state name, choose
Custom, and add
Sets the Simulink based state as a Stateflow test point. For more information, see Monitor Test Points in Stateflow Charts.
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 interval limits the amount of data logged by skipping samples. Default value is 2, which means the chart logs every other sample.
Specify the code format generated for a Simulink based state. You can set the format to one of these options:
Auto — Simulink Coder™ software chooses the optimal format for you based on the type and number of instances of the subsystem that exist in the model.
Inline — Simulink Coder software inlines the subsystem unconditionally.
Nonreusable function — Simulink Coder software explicitly generates a separate function in a separate file.
Reusable function — Simulink 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).
Simulink based state description. You can enter brief descriptions of Simulink based states in the hierarchy.
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.