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

可变大小数据

定义,代码生成的差异,动态内存分配

函数

coder.varsizeDeclare variable-size data

主题

可变大小数组的代码生成

可变大小数据是其大小在编译时未知或其大小在运行时可能发生变化的数据。

Define Variable-Size Data for Code Generation

Choose a method for defining variable-size data.

Control Memory Allocation for Variable-Size Arrays

Control when dynamic memory allocation is used.

Generate Code for Variable-Size Data

Generate code for data whose size might change at run time.

Specify Upper Bounds for Variable-Size Arrays

To avoid dynamic memory allocation, specify upper bounds for a variable-size array.

在生成的函数接口中使用 C 数组

了解和使用生成的函数接口中的数组

Incompatibilities with MATLAB in Variable-Size Support for Code Generation

Sometimes, 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.