| Stateflow User's Guide | ![]() |
This topic is a reference of the parts of a truth table and the edit operations that you can perform in the truth table editor as shown.
The major editing operations in the truth table editor are described in the topics that follow.
Adding or Modifying Stateflow Data
| Select the Goto Explorer tool to add or modify Stateflow data with the Model Explorer tool. |
Appending Rows and Columns
| Click the Append Column tool to append a column on the right end of the selected table. |
|
| Click the Append Row tool to append a row to the bottom of the selected table. |
Compacting the Table
| Select the Compact Table tool to remove the empty rows and columns of the selected table. |
Copy, Cut, and Paste Table Element.
Deleting Text, Rows, and Columns
To delete the contents of a cell, do the following:
To delete an entire row or column, do the following:
Diagnosing the Truth Table
| Select the Run Diagnostics tool to check the truth table for syntax errors. |
Editing Tables
Both the default Condition Table and the default Action Table have one empty row. Click a cell to edit its text contents. Use Tab and Shift+Tab to move horizontally between cells. To add rows and columns to either table, see Appending Rows and Columns.
You set the Truth Table editor to display only one of the two tables by double-clicking the header of the table to display. To revert to the display of both tables, double-click the header of the displayed table.
Cells for the numbered rows in decision columns like D1 can take values of T, F, or -. Once you select one of these cells, you can use the spacebar to step through the T, F, and - values. In these cells you can use the left, right, up, and down arrow keys to advance to another cell in any direction.
Increasing and Decreasing Row Height
| Select the Increase Row Height tool to increase the row height of the selected row. |
|
| Select the Decrease Row Height tool to decrease the row height of the selected row. |
Inserting Rows and Columns
To insert a blank row above an existing table row,
To insert a blank decision column to the left of an existing decision column,
Moving Rows and Columns
Printing Tables
| Select the Print tool to make a printed copy or an online viewable copy (HTML file) of the truth table. |
Selecting and Deselecting Table Elements
Undoing and Redoing Edit Operations
| Select the Undo tool or press Ctrl+Z to reverse the effects of the preceding operation. |
|
| Select the Redo tool or press Ctrl+Y to reverse the effects of the most recently undone edit operation. |
Viewing the Stateflow Diagram for the Truth Table
| Select the Go to Diagram tool to display the current truth table function in its native Stateflow diagram. |
| Truth Table Editor Operations | Searching and Replacing in Truth Tables | ![]() |
© 1994-2005 The MathWorks, Inc.