| Contents | Index |
| On this page… |
|---|
Adding or Modifying Stateflow Data Deleting Text, Rows, and Columns Selecting and Deselecting Table Elements |
| Edit Data/Ports opens the Model Explorer so that you can add or modify Stateflow data. |
| Append Column adds a column on the right end of the selected table. |
| Append Row adds a row to the bottom of the selected table. |
| Compact Table removes the empty rows and columns of the selected table. |
To delete the contents of a cell:
To delete an entire row or column:
From the context menu, select Delete Row or Delete Column.
You can also click the row or column header to select the entire row or column and press the Delete key.
| Run Diagnostics checks the truth table for syntax errors. See Debugging a Truth Table. |
| View Generated Content displays the code generated for the truth table. Stateflow Classic truth tables generate graphical functions. MATLAB truth tables generate MATLAB code. For details, see How Stateflow Software Generates Content for Truth 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 -. After 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.
To insert a blank row above an existing table row:
To insert a blank decision column to the left of an existing decision column:
To move a condition or action row up or down:
Click the row header to select the row.
Drag the row to a new position.
The Truth Table Editor renumbers the rows automatically.
To move a decision column left or right:
Click the column header to select the column.
Drag the column to a new position.
The Truth Table Editor renumbers the decision columns automatically.
| Print makes a printed copy or an online viewable copy (HTML file) of the truth table. |
| To... | Perform this action... |
|---|---|
| Select a cell for editing | Click the cell |
| Select text in a cell | Click and drag your pointer over the text |
| Select a row | Click the header for the row |
| Select a decision column in the Condition Table | Click the header for the column |
| Deselect a selected cell, row, or column | Press Esc or click another table, cell, row, or column |
| Click the Undo button or press Ctrl+Z (Command+Z) to undo the effects of the preceding operation. |
| Click the Redo button or press Ctrl+Y (Command+Y) to redo the most recently undone operation. |
| Go to Editor displays the current truth table function in its native chart. |
![]() | How Stateflow Software Generates Content for Truth Tables | Using MATLAB Functions in Stateflow Charts | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |