Main Content

Unexpected backtracking

Diagnostic action to take when unexpected backtracking is detected

Model Configuration Pane: Diagnostics


The Unexpected backtracking parameter specifies the diagnostic action to take when a chart junction has both of the following conditions. The junction:

  • Does not have an unconditional transition path to a state or a terminal junction

  • Has multiple transition paths leading to it

This chart configuration can lead to unwanted backtracking during simulation.

To avoid unwanted backtracking, consider adding an unconditional transition from the chart junction to a terminal junction.


error (default) | none | warning

No warning or error appears.


A warning appears with a link to examples of unwanted backtracking.


An error appears and stops the simulation.

Recommended Settings

TraceabilityNo impact
EfficiencyNo impact (for simulation)
No impact (for production code generation)
Safety precautionerror

Programmatic Use

Parameter: SFUnexpectedBacktrackingDiag
Value: 'none' | 'warning' | 'error'
Default: 'error'

Version History

Introduced in R2010a