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.
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.
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
Attribute Name | Class | Description |
---|---|---|
| logical default = | If For handle classes, setting |
| logical default = | If
|
|
| Use
List of classes that have get and set access to this property. Specify classes as
|
| logical default = | Set to
See Define Class Properties with Constant Values for more information. |
| logical default = | If MATLAB does not display in the command window the names and values of Values returned by dependent property get methods are not considered when testing for object equality using |
| enumeration default = |
List classes that have get access to this property. Specify classes as
MATLAB does not display in the command window the names and values of properties having The |
| logical default = | If true , and it is a handle class property, then you can create listeners for access to this property. The listeners are called whenever property values are queried. See Property-Set and Query Events |
| logical default = | Determines if the property can be shown in a property list (e.g., Property Inspector, call to MATLAB does not display in the command window the names and values of properties whose |
| logical default = | Determine if property value can be copied when object is copied. You can set For more information, see Exclude Properties from Copy |
| Positive integer default = 1 | Use only with subclasses of For more information, see Set Priority for Matching Partial Property Names. |
| enumeration default = |
See Properties Containing Objects and Mutable and Immutable Properties List classes that have set access to this property. Specify classes as
|
| logical default = | If true , and it is a handle class property, then you can create listeners for access to this property. The listeners are called whenever property values are modified. See Property-Set and Query Events
|
| logical default = | If |
Framework attributes | Classes that use certain framework base classes have framework-specific attributes. See the documentation for the specific base class you are using for information on these attributes. |