Array Size Restrictions for Code Generation - MATLAB & Simulink (original) (raw)

Main Content

For code generation, the maximum number of elements of an array is constrained by the code generator and the target hardware.

For fixed-size arrays and variable-size arrays that use static memory allocation, the maximum number of elements is the smaller of:

For variable-size arrays that use dynamic memory allocation, the maximum number of elements is the smaller of:

These restrictions apply even on a 64-bit platform.

For a fixed-size array, if the number of elements exceeds the maximum, the code generator reports an error at compile time.

For a variable-size array, if the number of elements exceeds the maximum at run time, the error checking behavior depends on the code generation target:

See Also

coder.HardwareImplementation