Documentation Center

  • Trial Software
  • Product Updates

State Transition Matrix View for State Transition Tables

This example shows the State Transition Matrix view for a simple model of a debouncing logic that uses State Transition Tables in Stateflow® (new in R2012b).

A State Transition Matrix is an alternative view of the State Transition Table. This view enables you to quickly find out how the state transition table responds to various input conditions. Consider a simple State Transition Table for modeling debouncing logic as shown below:

Such logic is commonly used to remove jitter in switching logic. To generate the State Transition Matrix view, select Table > View State Transition Matrix in the State Transition Table editor

The left most column represents the states in the table. Every unique condition used in the state transition table is represented by one column. The column represents how each state responds to that particular condition. If a state does not have an outer transition guarded by that condition, the cell is left empty. By scanning down the column, you can quickly find out how the input condition (or event) is handled in the various operating modes. If you wish to document the fact that a particular state does not respond to a condition (or event), you can add an outer transition where the destination state has been specified as %IGNORE%. This prevents an actual transition from being drawn in the diagram while still showing up in the State Transition Matrix view.

Note that in the presence of hierarchy, each hierarchical level is treated separately so that you get multiple tables for each parent level. This is because often, the conditions used at different levels have little to do with each other.

Was this topic helpful?