Main Content

Array bounds exceeded


Ensure that Simulink®-allocated memory used in S-functions does not write beyond its assigned array bounds when writing to its outputs, states, or work vectors.

Category: Diagnostics


Default: none


Simulink software takes no action.


Simulink software displays a warning.


Simulink software terminates the simulation and displays an error message.


  • Use this option to check whether execution of each instance of a block during model simulation writes data to memory locations not allocated to the block. This can happen only if your model includes a user-written S-function that has a bug.

  • Enabling this option slows down model execution considerably. Thus, you should enable it only if you suspect that your model contains a user-written S-function that has a bug.

  • This option causes Simulink software to check whether a block writes outside the memory allocated to it during simulation. Typically this can happen only if your model includes a user-written S-function that has a bug.

  • See Checking Array Bounds in Handle Errors in S-Functions for more information on using this option.

  • For models referenced in Accelerator mode, Simulink ignores the Array bounds exceeded parameter setting if you set it to a value other than None.

    You can use the Model Advisor to identify referenced models for which Simulink changes configuration parameter settings during accelerated simulation.

    1. In the Simulink Editor, in the Modeling tab, click Model Advisor, then click OK.

    2. Select By Task.

    3. Run the Check diagnostic settings ignored during accelerated model reference simulation check.

Command-Line Information

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

Recommended Settings

TraceabilityNo impact
Safety precautionNo impact

Related Topics