主要内容

MATLAB

MATLAB® 类的仿真和代码生成

您可以在 MATLAB Function 模块中使用 MATLAB 类,包括值类、句柄类和 System object。要了解有关 MATLAB 中值和句柄类的更多信息,请参阅句柄类和值类的比较。要了解有关 System object 的更多信息,请参阅何谓 System object?

MATLAB Function 模块中使用类时,您必须注意某些用法说明和限制。

模块

MATLAB FunctionSimulink 模型中包含 MATLAB 代码
MATLAB System在模型中包含 System object

主题

疑难解答

Resolve Error: Handle Object Referenced by Persistent Variable (MATLAB Coder)

Troubleshoot error when using a persistent handle object.

Resolve Error: Nontunable Property Cannot Be Defined by Subscripted Assignment (MATLAB Coder)

Troubleshoot code generation failure when a System object uses a structure.

Resolve Error: Class Properties Must Be Fully Defined Before Use (MATLAB Coder)

Troubleshoot code generation error when class properties are not defined before use.

Resolve Error: Cannot Reference Handle Object Outside of Loop (MATLAB Coder)

Troubleshoot error when creating or allocating a handle object inside a for-loop.

类没有属性 (MATLAB Coder)

句柄类的属性赋值问题故障排除。

某些属性不支持按引用传递 (MATLAB Coder)

某些属性无法与 coder.refcoder.rrefcoder.wref 结合使用。

Resolve Error: coder.varsize Not Supported for Class Properties (MATLAB Coder)

Troubleshoot code generation error when using coder.varsize with properties of a MATLAB class.