Array Size Restrictions for Code Generation

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:

intmax('int32').

The largest integer that fits in the C int data type on
the target hardware.

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

intmax('int32').

The largest power of 2 that fits in the C int data type
on the target hardware.

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 during simulation, the software reports an
error. Generated standalone code cannot report array size violations.

MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

This website uses cookies to improve your user experience, personalize content and ads, and analyze website traffic. By continuing to use this website, you consent to our use of cookies. Please see our Privacy Policy to learn more about cookies and how to change your settings.