Main Content

Guidelines for Naming Stateflow Objects

You can name Stateflow® objects with a combination of alphanumeric and underscore characters.

  • Names cannot begin with a numeric character or contain embedded spaces.

  • By default, names have a maximum length of 31 characters. To change the maximum length, set the Maximum identifier length parameter. The parameter accepts values between 31 and 2048.

  • Avoid using reserved keywords to name Stateflow objects. These keywords are part of the action language syntax.

Note

Do not use the file names sf.slx for Simulink® models or sf.sfx for standalone Stateflow charts in MATLAB®. Using these file names can shadow Stateflow program files and result in unpredictable behavior.

Reserved Keywords

Usage in Action Language SyntaxKeywordsSyntax References
Change detection Detect Changes in Data and Expression Values
Complex data
  • complex

  • imag

  • real

Operations for Complex Data in Stateflow
Data type operations

Type Cast Operations

Specify Scope and Type of Stateflow Data

Data types Specify Scope and Type of Stateflow Data
Edge detection Detect Changes in Data and Expression Values
Events

Broadcast Local Events to Synchronize Parallel States

Control Chart Behavior by Using Implicit Events

Interface with MATLAB code

Access MATLAB Functions and Workspace Data in C Charts

Model a Power Window Controller

Simulate a Media Player

Literal symbols
  • false

  • inf

  • t

  • true

Supported Symbols in Actions
Messages Control Message Activity in Stateflow Charts
State actions
  • bind

  • du

  • during

  • en

  • entry

  • ex

  • exit

  • on

Represent Operating Modes by Using States
State activity Check State Activity by Using the in Operator
String manipulation

Manage Textual Information by Using Strings

Note

These operator names are reserved keywords only in charts that use C as the action language.

Temporal logic Control Chart Execution by Using Temporal Logic
Test model simulation

Verify Model Simulation by Using when Decomposition (Simulink Test)

Note

The verify operator requires Simulink Test™.

See Also

Topics