| Stateflow User's Guide | ![]() |
Assigning Truth Table Actions to Decisions
You must assign at least one action from the Action Table to each decision in the Condition Table. In Entering Truth Table Actions, you enter actions in the rows of the Action Table. In this topic, you learn how to link the actions you enter in the Action Table to the decisions you enter in the Condition Table using the Actions row in the Condition Table.
A1 for decision column D1, that links the action labeled A1 in the Action Table to decision D1.
In this example, the Actions row cell for each decision column contains a label specified for each action in the Action Table. Decision D1 is assigned the action t=1. Decision D2 is assigned the action t=2, and so on.
When the truth table executes, the decisions are tested in left to right column order. If a decision is tested as true, its action is immediately executed and the truth table is exited.
You can also specify the action for a decision with the row number for the appropriate action in the Action Table. For example, you can enter 1 in place of A1 for decision column D1 to specify the same action. These and other options are described with examples in the section Options for Assigning Actions to Decisions in Truth Tables. For now, continue with the final step in programming a truth table, Adding Initial and Final Actions.
| Entering Truth Table Actions | Adding Initial and Final Actions | ![]() |
© 1994-2005 The MathWorks, Inc.