Products & Services Solutions Academia Support User Community Company

Learn more about Stateflow   

Language Options for Stateflow Truth Tables

Stateflow Classic Truth Tables

Using Stateflow Classic truth tables, you can specify conditions and actions using the Stateflow action language, which supports basic C constructs and provides access to MATLAB functions using the ml namespace operator or ml function. For more information about the Stateflow action language, see Using Actions in Stateflow Charts.

Stateflow Classic mode is the default setting for Stateflow truth tables.

Embedded MATLAB Truth Tables

You can specify conditions and actions for Embedded MATLAB truth tables by using Embedded MATLAB action language, a restricted subset of the MATLAB language that provides optimizations for code generation.

Embedded MATLAB truth tables offer several advantages over Stateflow Classic truth tables:

Selecting a Language for Stateflow Truth Tables

To specify an action language for your Stateflow truth table, follow these steps:

  1. Double-click the truth table to open the Truth Table Editor.

  2. Select Language from the Settings menu.

  3. Choose a language from the drop-down menu.

Migration from Stateflow Classic to Embedded MATLAB Truth Tables

When you migrate from a Stateflow Classic truth table to an Embedded MATLAB truth table, you must verify that the code used to program the actions conforms to Embedded MATLAB syntax. Between the two action languages, these differences exist.

For this type of action language...Indices are...And the expression for not equal to is...
Embedded MATLABOne-based~=
StateflowZero-based!=

You can check for syntax errors by using the Run Diagnostics command in the Truth Table Editor, as described in Checking Truth Tables for Errors.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS