MATLAB Object-Oriented Programming

(Joyce) #1

Method Attributes


In this section...
“Purpose of Method Attributes” on page 9-5
“Specifying Method Attributes” on page 9-5
“Table of Method Attributes” on page 9-5

Purpose of Method Attributes


Specifying attributes in the class definition enables you to customize the behavior of
methods for specific purposes. Control characteristics like access, visibility, and
implementation by setting method attributes. Subclasses do not inherit superclass
member attributes.

Specifying Method Attributes


Assign method attributes on the same line as the methods keyword:

methods (Attribute1 = value1, Attribute2 = value2,...)
...
end

For more information on attribute syntax, see “Attribute Specification” on page 5-22.

Table of Method Attributes


Attributes enable you to modify the behavior of methods. All methods support the
attributes listed in the following table.

Attribute values apply to all methods defined within the methods...end code block that
specifies the nondefault values.

Method Attributes
Free download pdf