Contenido principal

Clases de MATLAB

Simulación y generación de código para clases de MATLAB®

Puede utilizar las clases de MATLAB, incluidas clases de valores, clases de identificadores y System objects, en un bloque MATLAB Function. Para obtener más información sobre las clases de valores y de identificadores de MATLAB, consulte Comparison of Handle and Value Classes. Para obtener más información sobre los System objects, consulte What Are System Objects?.

Debe tener en cuenta ciertas indicaciones y limitaciones de uso cuando utilice clases en un bloque MATLAB Function.

Bloques

MATLAB FunctionInclude MATLAB code in Simulink models
MATLAB SystemInclude System object in model

Temas

Solución de problemas

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.

Resolve Error: Class Does Not Have Property (MATLAB Coder)

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

Resolve Error: Passing by Reference Not Supported for Some Properties (MATLAB Coder)

Troubleshoot error when you use certain types of properties with coder.ref, coder.rref, or coder.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.