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. MATLAB classes are converted to C++ classes in the generated HLS code.

Topics

Code Generation Basics

Usage Notes and Limitations

Troubleshooting

Resolve Error: Class Does Not Have Property

Troubleshoot issues when you assign a value to a property of a handle class that is returned by a method.

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.

Resolve Error: Passing by Reference Not Supported for Some Properties

Troubleshoot error when you use certain types of properties with coder.ref, coder.rref, or coder.wref.

Resolve Error: Code Generation Does Not Support String and Object Arrays

Troubleshoot error when you use an object or string array in your MATLAB code.