Stateflow User's Guide Previous page   Next Page

Truth Table Editor Reference

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.


Click the Copy tool to copy the selected row, column, or text.


Click the Cut tool to cut the selected row, column, or text.


Click the Paste tool to paste the cut or copied element as follows:
  • Cut or copied text is inserted at the cursor location.
  • If you select a decision column before pasting a cut or copied decision column, the pasted decision column is inserted to the left of the selected column.
  • If you select a row before pasting a cut or copied row, the pasted row is inserted above the selected row.

Deleting Text, Rows, and Columns

To delete the contents of a cell, do the following:

  1. Right-click the cell.
  2. From the resulting pop-up menu, select Delete Cell.

To delete an entire row or column, do the following:

  1. Right-click the row or column header.
  2. From the resulting pop-up menu, select Delete Row or Delete Column.
  1. You can also click the row or column header to select the entire row or column and press the Delete key.

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,

  1. Right-click any cell in the row (including the row header).
  2. From the resulting pop-up menu, select Insert Row.

To insert a blank decision column to the left of an existing decision column,

  1. Right-click any cell in the existing decision column (including the column header).
  2. From the resulting pop-up menu, select Insert Column.

Moving Rows and Columns


Click the Move Up tool to move a selected row up one row.


Click the Move Down tool to move a selected row down one row.


Click the Move Right tool to move a selected column right one column.

Click the Move Left tool to move a selected column left one column.

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.


Previous page  Truth Table Editor Operations Searching and Replacing in Truth Tables Next page

© 1994-2005 The MathWorks, Inc.