Main Content

MATLAB Classes

HLS code generation for MATLAB® classes

You can generate code for MATLAB classes, including value classes, handle classes, and System object™. Your class can have multiple methods and properties and can inherit from multiple classes. In the generated HLS code, MATLAB classes are represented as structures. If you generate C++ code, the default behavior of the code generator is to generate C++ classes for the MATLAB classes.

Topics

Code Generation Basics

Usage Notes and Limitations

Troubleshooting

Handle Object Limitations for Code Generation

Adhere to code generation restrictions for handle objects.

Class Does Not Have Property

Troubleshoot issues with assignment of a property of a handle class.

Passing by Reference Not Supported for Some Properties

You cannot use certain properties with coder.ref, coder.rref, or coder.wref.

Work Around Language Limitation: Code Generation Does Not Support Object Arrays

Troubleshoot code generation failure for arrays of objects in your MATLAB code.