| Stateflow User's Guide | ![]() |
Adding Initial and Final Actions
In addition to the actions for decisions, Stateflow also lets you add initial and final actions to the truth table function. Initial actions specify an action that executes before any decisions are tested. Final actions specify an action that executes as the last action before the truth table is exited. To specify initial and final actions for a truth table, use the action labels INIT and FINAL in the Action Table.
Use the following procedure to add initial and final actions to display diagnostic messages in the MATLAB Command Window before and after the execution of the truth table ttable:
Even though the initial and final actions for the preceding truth table example are shown in the first and last rows of the Action Table, you can enter these actions in any row. You can also explicitly assign the initial and final actions to decisions by using the action specifier INIT or FINAL in the Actions row of the Condition Table.
| Assigning Truth Table Actions to Decisions | Debugging a Truth Table | ![]() |
© 1994-2005 The MathWorks, Inc.