主要内容

MATLAB

MATLAB® 类的 HLS 代码生成

您可以为 MATLAB 类生成代码,包括值类、句柄类和 System object™。您的类可以有多个方法和属性,并且可以从多个类继承。MATLAB 类在生成的 HLS 代码中转换为 C++ 类。

主题

代码生成基础知识

用法说明和限制

疑难解答

类没有属性

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

Resolve Error: Handle Object Referenced by Persistent Variable

Troubleshoot error when using a persistent handle object.

Resolve Error: Nontunable Property Cannot Be Defined by Subscripted Assignment

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

Resolve Error: Class Properties Must Be Fully Defined Before Use

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

Resolve Error: Cannot Reference Handle Object Outside of Loop

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

某些属性不支持按引用传递

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

解决语言限制:代码生成不支持对象数组

对 MATLAB 代码中对象数组的代码生成失败进行故障排除。