Data Definition Basics

Data, variables, and functions for code acceleration

Examples and How To

Eliminate Redundant Copies of Variables in Generated Code

Use coder.nullcopy to indicate that the code generator can allocate memory without initializing it.

Reuse the Same Variable with Different Properties

Reuse a variable with different properties when the code generator can determine the properties of each occurrence of the variable.

Avoid Overflows in for-Loops

Use certain coding techniques to avoid overflow of the loop variable.


Data Definition for Code Generation

Define data in MATLAB® code intended for code generation.

Variables Definition for Code Generation

Define the class, size, and complexity of variables in MATLAB source code before using them.

Best Practices for Defining Variables for C/C++ Code Generation

Follow guidelines for defining variables in MATLAB code intended for code generation.

Reassignment of Variable Properties

Reassign a variable with a value of different class, size, or complexity.

Supported Variable Types

Use data types that code generation supports.

Code Generation for Complex Data

Use complex data in MATLAB code intended for code generation.

Encoding of Characters in Code Generation

Differences in character encoding between MATLAB and code generation can result in errors or different answers.

Array Size Restrictions for Code Generation

The code generator and the target hardware constrain the maximum number of elements of an array.

Was this topic helpful?