| Stateflow User's Guide | ![]() |
Entering Truth Table Conditions
Conditions are the starting point for specifying logical behavior in a truth table. You open the truth table ttable for editing in Opening a Truth Table for Editing. In this topic, you start programming the behavior of ttable by specifying its conditions.
You enter conditions in the Condition column of the Condition Table. For each condition that you enter, you can also enter an optional description in the Description column. Use the following procedure to enter the conditions of the truth table ttable:
The Action row of the Condition Table is slightly obscured by the pane of the Action Table.
Condition labels must begin with an alphabetic character ([a-z][A-Z]) followed by any number of alphanumeric characters ([a-z][A-Z][0-9]) or an underscore (_). In the generated code for a truth table, the condition label becomes the name of a temporary data variable that stores the outcome of its condition. If no label is entered, Stateflow names a temporary variable of its own.
[x == 1]) as you would in Stateflow action language.
You can use data passed to the truth table function through its arguments in truth table conditions. The preceding condition tests whether the argument x is equal to 1. You can also use data defined for parent objects of the truth table in Stateflow, including the Stateflow diagram.
| Opening a Truth Table for Editing | Entering Truth Table Decisions | ![]() |
© 1994-2005 The MathWorks, Inc.