Variable-Size Data

Variable-size data for code acceleration, dynamic memory allocation


coder.typeof Convert MATLAB value into its canonical type
coder.varsize Declare variable-size array

Examples and How To

Define Variable-Size Data for Code Generation

Choose a method for defining variable-size data.

Control Memory Allocation of Variable-Size Data

Control when dynamic memory allocation is used.

Specify Variable-Size Data Without Dynamic Memory Allocation

Specify upper bounds for variable-size data.


What Is Variable-Size Data?

Variable-size data is data whose size can change at run time.

Variable-Size Data Definition for Code Generation

Use variable-size data in MATLAB® code intended for code generation.

Bounded Versus Unbounded Variable-Size Data

Bounded variable-size data has fixed upper bounds whereas unbounded variable-size data does not.

Variable-Size Data in Code Generation Reports

View variable-size data in code generation reports.

C Code Interface for Arrays

Use the programming interface for statically and dynamically allocated arrays in generated code.

Incompatibilities with MATLAB in Variable-Size Support for Code Generation

In some cases, the results for variable-size data in generated code are different than the results in MATLAB.

Variable-Sizing Restrictions for Code Generation of Toolbox Functions

Some restrictions for variable-size data apply to multiple toolbox functions.


Diagnose and Fix Variable-Size Data Errors

Troubleshoot size mismatch and upper bounds detection errors.

Was this topic helpful?