Documentation Center

  • Trial Software
  • Product Updates

Rules for Naming Stateflow Objects

Characters You Can Use

You can name Stateflow® objects with any combination of alphanumeric and underscore characters. Names cannot begin with a numeric character or contain embedded spaces.

Restriction on Name Length

Name length should comply with the maximum identifier length enforced by Simulink® Coder™ software. You can set this parameter in the Code Generation > Symbols pane of the Configuration Parameters dialog box. The default is 31 characters and the maximum length you can specify is 256 characters.

Keywords to Avoid When Naming Chart Objects

You cannot use reserved keywords to name chart objects. These keywords are part of the action language syntax.

Usage in Action Language SyntaxKeywordsSyntax References
Boolean symbols
  • true

  • false

Boolean Symbols, true and false
Change detection
  • hasChanged

  • hasChangedFrom

  • hasChangedTo

Detect Changes in Data Values
Complex data
  • complex

  • imag

  • real

Define Complex Data Using Operators
Data types
  • boolean

  • double

  • int8

  • int16

  • int32

  • single

  • uint8

  • uint16

  • uint32

Set Data Properties
Data type operations
  • cast

  • fixdt

  • type

Type Cast Operations
Explicit events
  • send

Broadcast Events to Synchronize States
Implicit events
  • change

  • chg

  • tick

  • wakeup

Control Chart Execution Using Implicit Events
Literal symbols
  • inf

  • t

Supported Symbols in Actions
MATLAB® functions and data
  • matlab

  • ml

ml Namespace Operator
State actions
  • bind

  • du

  • during

  • en

  • entry

  • ex

  • exit

  • on

Supported Action Types for States and Transitions
State activity
  • in

Check State Activity
Temporal logic
  • after

  • at

  • before

  • every

  • sec

  • msec

  • usec

  • temporalCount

Control Chart Execution Using Temporal Logic

Was this topic helpful?