MATLAB Object-Oriented Programming

(Joyce) #1

Property Attributes


In this section...
“Purpose of Property Attributes” on page 8-9
“Specifying Property Attributes” on page 8-9
“Table of Property Attributes” on page 8-9

Purpose of Property Attributes


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

Specifying Property Attributes


Assign property attributes on the same line as the properties keyword:

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

For example, give the Data property private access:

properties (Access = private)
Data
end

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

Table of Property Attributes


All properties support the attributes listed in the following table. Attribute values apply to
all properties defined within the properties...end code block that specifies the
nondefault values.

Property Attributes
Free download pdf