| Stateflow User's Guide | ![]() |
Entering Truth Table Decisions
Each decision column (D1, D2, and so on) binds a group of condition outcomes together with an AND relationship into a decision. The allowed values for the condition outcomes in a decision are T (true), F (false), and - (true or false). In Entering Truth Table Conditions you enter conditions for the truth table ttable in the truth table editor. Continue by entering decisions in the decision columns with the following steps:
F, -, and T. You can also enter these characters directly. All other entries are rejected.
During execution of the truth table, decisions are tested in left to right order. The order of testing for individual condition outcomes within a decision is undefined. The current implementation of truth tables in Stateflow evaluates the conditions for each decision in top-down order (first condition 1, then condition 2, and so on). Because this implementation is subject to change in the future, you must not depend on a particular evaluation order.
The Default Decision Column
The last decision column in ttable, D4, is the default decision for this truth table. The default decision covers any remaining decisions not tested for in preceding decision columns to the left. You enter a default decision as the last decision column on the right with an entry of - for all conditions in the decision, where - represents any outcome for the condition.
In the preceding example, the following decisions are specified by the default decision column, D4:
| Condition |
Decision 4 |
Decision 5 |
Decision 6 |
Decision 7 |
Decision 8 |
| x == 1 |
F |
T |
F |
T |
T |
| y == 1 |
F |
F |
T |
T |
T |
| z == 1 |
F |
T |
T |
F |
T |
| Entering Truth Table Conditions | Entering Truth Table Actions | ![]() |
© 1994-2005 The MathWorks, Inc.