이 페이지의 최신 내용은 아직 번역되지 않았습니다. 최신 내용은 영문으로 볼 수 있습니다.
MATLAB 클래스 정의는 속성, 메서드, 이벤트를 정의하는 코드 블록으로 구성됩니다. 각 블록에서는 해당하는 특정 블록에 정의된 모든 속성, 메서드 또는 이벤트에 적용되는 특성(Attribute)을 선언할 수 있습니다. 특성은 클래스 자체에도 적용될 수 있습니다.
class | 객체의 클래스 |
isobject | 입력값이 MATLAB 객체인지 확인 |
enumeration | 클래스의 열거형 멤버와 이름 |
events | 이벤트 이름 |
methods | 클래스 메서드(Class Method) 이름 |
properties | 클래스 속성 이름 |
superclasses | Names of superclasses |
코드 블록 내 모든 클래스 멤버에 특성을 적용하는 클래스 구성요소를 코드 블록에 정의합니다.
경로 폴더에 클래스를 구성하거나 클래스 @ 폴더의 여러 파일에 클래스 정의를 나누어 배치합니다.
The classdef
block contains the class definition including all class member blocks.
Define properties in a properties
block that specifies the property name, and optional type, default value, and attributes.
methods
블록에 메서드를 정의합니다. methods 블록은 블록 내 정의된 모든 메서드에 대한 특성을 지정합니다.
property
, methods
또는 events
블록에 특성을 지정할 수 있습니다. 특성은 이 블록에 정의된 모든 멤버에 적용됩니다.
Define event names in an events
block. Only handle classes support events.
This example of a MATLAB class definition shows syntax and programming techniques used in typical classes.