주요 콘텐츠

MATLAB 클래스

MATLAB® 클래스에 대한 코드 생성

값 클래스, 핸들 클래스, System object를 사용하는 MATLAB 함수에 대한 코드를 생성할 수 있습니다. MATLAB의 값 클래스와 핸들 클래스에 대한 자세한 내용은 핸들 클래스와 값 클래스 비교 항목을 참조하십시오. System object에 대한 자세한 내용은 System object란? 항목을 참조하십시오.

코드 생성을 위한 MATLAB 코드에서는 다음을 수행할 수 있습니다.

  • MATLAB 코드에 MATLAB 값 클래스 또는 핸들 클래스를 사용할 수 있습니다.

  • MATLAB 값 클래스를 MATLAB 진입점에 대한 입력 인수로 사용할 수 있습니다.

C 코드를 생성할 경우 MATLAB 클래스는 구조체로 표현됩니다. C++ 코드를 생성하는 경우 코드 생성기의 디폴트 동작은 MATLAB 클래스에 대해 C++ 클래스를 생성하는 것입니다. 코드 생성을 위한 MATLAB 코드에 클래스를 사용하는 경우 특정 사용법 관련 참고 및 제한 사항을 알고 있어야 합니다.

클래스

coder.ClassType입력 사양에 허용되는 MATLAB 클래스 집합 표현

객체

coder.ClassSignatureEntry-point class for code generation (Tech Preview) (R2026a 이후)
coder.FunctionSignatureEntry-point function or method for code generation (Tech Preview) (R2026a 이후)

함수

addMethodAdd method specification to coder.ClassSignature object (Tech Preview) (R2026a 이후)

도움말 항목

코드 생성 기본 사항

MATLAB 클래스를 진입점으로 사용(Tech Preview)

MATLAB 함수에서 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.

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: 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 Generator Failed to Produce C++ Destructor for MATLAB Class

Troubleshoot generation of standalone code for C++ destructor of a MATLAB class.

언어 제한 사항 해결: 코드 생성 시 객체 배열은 지원되지 않습니다

MATLAB 코드에서 객체로 구성된 배열에 대한 코드 생성 실패 문제를 해결합니다.

Resolve Error: coder.varsize Not Supported for Class Properties

Troubleshoot code generation error when using coder.varsize with properties of a MATLAB class.

추천 예제