MATLAB 类
您可以为 MATLAB 类生成代码,包括值类、句柄类和 System object™。您的类可以有多个方法和属性,并且可以从多个类继承。MATLAB 类在生成的 HLS 代码中转换为 C++ 类。
主题
代码生成基础知识
- Generate HLS Code for MATLAB Value Classes
Use a value class in MATLAB code intended for HLS code generation. - Generate HLS Code for MATLAB Handle Classes and System Objects
Use a System object in MATLAB code intended for code generation. - Generate C++ Classes for MATLAB Classes
Generate a C++ class for a value class, handle class, or System object in your MATLAB code.
用法说明和限制
- 用于代码生成的 MATLAB 类定义
在用于进行代码生成的 MATLAB 代码中使用类。 - 为代码生成定义类属性
- System Object Considerations for HLS Code Generation
Special considerations for using System object in code generated from MATLAB. - 句柄类析构函数的代码生成
在用于进行代码生成的 MATLAB 代码中使用句柄类析构函数。
疑难解答
句柄类的属性赋值问题故障排除。
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.ref、coder.rref 或 coder.wref 结合使用。
对 MATLAB 代码中对象数组的代码生成失败进行故障排除。