Classdef Block
In this section...
“How to Specify Attributes and Superclasses” on page 5-10
“Class Attribute Syntax” on page 5-10
“Superclass Syntax” on page 5-11
“Local Functions in Class File” on page 5-11
How to Specify Attributes and Superclasses
The classdef block contains the class definition. The classdef line is where you
specify:
- Class attributes
- Superclasses
The classdef block contains the properties, methods, and events subblocks.
Class Attribute Syntax
Class attributes modify class behavior in some way. Assign values to class attributes only
when you want to change their default value.
No change to default attribute values:
classdef ClassName
...
end
One or more attribute values assigned:
classdef (attribute1 = value,...)
...
end
For example, the TextString class specifies that it cannot be used to derive subclasses:
classdef TextString (Sealed)
...
end
5 Class Definition—Syntax Reference