Main Content

Array bounds exceeded

Diagnostic behavior when S-function writes beyond array bounds assigned in allocated memory

Model Configuration Pane: Diagnostics / Data Validity


This parameter specifies the diagnostic behavior in the software when an S-function writes to memory locations not allocated for the block. Writing outputs, states, or work vectors outside of the memory allocated for the block indicates a bug in the S-function. For more information, see Handle Errors in S-Functions.

Setting this parameter to a value other than none degrades simulation performance. Set the parameter value to warning or error only to debug an S-function in your model.

The software ignores this parameter for referenced models that simulate in accelerator mode. You can use the Model Advisor to check for diagnostic parameters that are ignored for referenced models that simulate in accelerator mode.


none (default) | warning | error

Default: none


The software does not issue a diagnostic.


The software issues a warning.


The software issues an error and terminates the simulation.

Recommended Settings

TraceabilityNo impact
Safety precautionNo impact

Programmatic Use

Parameter: ArrayBoundsChecking
Type: string | character vector
Values: 'none' | 'warning' | 'error'
Default: 'none'

Version History

Introduced in R2006a