This example shows the State Transition Matrix view for a simple model of a debouncing logic that uses State Transition Tables in Stateflow®.
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. For example, this is a simple State Transition Table for modeling debouncing logic:
Such logic is commonly used to remove jitter in switching logic. To generate the State Transition Matrix view, select Chart > View State Transition Matrix in the State Transition Table editor
This is the State Transition Matrix view for the debouncer:
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.