이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
메서드는 클래스에 의해 정의된 연산입니다. 메서드는 MATLAB® 함수를 오버로드하여 클래스의 객체에 대해 연산을 수행할 수 있습니다. MATLAB은 상위(Dominant) 인수에 따라 호출할 메서드나 함수를 결정합니다. 클래스 생성자 메서드는 클래스의 객체를 생성하며, 특정 규칙을 따라야 합니다.
meta.method | 클래스 메서드에 대한 정보 |
다양한 종류의 메서드가 MATLAB 클래스에서 특정한 작업을 수행합니다.
methods
블록에 메서드를 정의합니다. methods 블록은 블록 내 정의된 모든 메서드에 대한 특성을 지정합니다.
MATLAB은 상위 인수를 사용하여 호출할 메서드를 결정합니다.
Specify a list of classes that can access a class method.
Object Precedence in Method Invocation
MATLAB dispatches to a specific method or function based on the dominant argument. There are rules that determine which argument is the dominant argument.
편의성과 효율성을 위해 개별 파일에 클래스 메서드를 정의할 수 있습니다.
메서드 특성은 메서드의 동작을 제어합니다.
Define ordinary methods within the class definition file using method blocks.
클래스 생성자는 클래스의 인스턴스를 생성하는 특수 메서드입니다.
정적 메서드에는 클래스의 객체가 입력 인수로 필요하지 않습니다.
Class Methods for Graphics Callbacks
There is a specific syntax necessary to use a method of your class as a callback for MATLAB graphics objects.
클래스에 대해 MATLAB 함수를 오버로드하면 클래스의 객체가 MATLAB 연산을 지원할 수 있습니다.
Dominant Argument in Overloaded Graphics Functions
If you want to define a method that accepts a MATLAB graphics object as the first arguments, specify the relative precedence of your class with respect to the graphics class.
Class Support for Array-Creation Functions
Add support for array-creation functions without overloading these functions in your class.
Objects In Conditional Statements
Enable the use of objects in conditional statements by defining relational operators for the class of the object.