本页对应的英文页面已更新,但尚未翻译。 若要查看最新内容,请点击此处访问英文页面。

数据定义基础知识

如何为代码生成定义数据、变量和函数

函数

halfConstruct half-precision numeric object

示例和操作指南

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.

概念

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.

支持的变量类型

使用代码生成支持的数据类型。

复数数据的代码生成

在用于代码生成的 MATLAB 代码中使用复数数据。

Code Generation for Sparse Matrices

Use sparse matrices in MATLAB code intended for code generation.

Code Generation for Constants in Structures and Arrays

Sometimes the code generator does not recognize constant structure fields or array elements.

Array Size Restrictions for Code Generation

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

特色示例