Class Attributes
指定类素质butes
All classes support the attributes listed in the following table. Attributes enable you to modify the behavior of class. Attribute values apply to the class defined within theclassdef
block.
classdef(Attribute1=value1,Attribute2=value2,...)ClassName...end
Class Attributes
Attribute Name |
Class |
Description |
---|---|---|
|
(default = |
If specified as SeeAbstract Classesfor more information. |
|
|
List classes that can subclass this class. Specify subclasses as
Specify SeeSpecify Allowed Subclassesfor more information. |
|
(default = |
If SeeInitialize Objects When Loadingfor more information. |
|
(default = |
If specified as |
|
(default = |
Iftrue , this class does not appear in the output of thesuperclasses orhelp functions. |
|
|
Use this attribute to establish a precedence relationship among classes. Specify a cell array of The fundamental classes are always inferior to user-defined classes and do not show up in this list. SeeClass PrecedenceandDominant Argument in Overloaded Graphics Functions. |
|
(default = |
If |
Specifying Attributes
Attributes are specified for class members in theclassdef
,properties
,methods
, andevents
definition blocks. The particular attribute setting applies to all members defined within that particular block. You can use multipleproperties
definition blocks to apply different attribute setting to different properties.
Superclass Attributes Are Not Inherited
Class attributes are not inherited, so superclass attributes do not affect subclasses.
Attribute Syntax
Specify class attribute values in parentheses, separating each attribute name/attribute value pair with a comma. The attribute list always follows theclassdef
or class member keyword, as shown:
classdef(属性名称=表达式, ...)ClassNameproperties(属性名称=表达式, ...) ...endmethods(属性名称=表达式, ...) ...endevents(属性名称=表达式, ...) ...endend