MATLAB: Does Stateflow 5.0 (R13) not throw an error when I simulate with out-of-range initial data

errormissingofoutoverflowr12.1pv1_swatrangestateflowuintunderrun

While using a demo model, I accidentally changed a data type from uint16 to uint8. The initial value was 499; this resulted in an erroneous simulation behavior. There is a missing compile/runtime range error when Stateflow data is initialized with values outside its range. The runtime data range checking is on, indicating a bug in the debug instrumentation of the simulation target. Therefore, the Stateflow Coder is also incorrect.

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This has been verified as a bug in Stateflow 5.0 (R13) in the way that out of range conditions are tested.
There are currently no known workarounds.