MATLAB 2009a Class Property Attributes

From ControlTheoryPro.com

Jump to: navigation, search
Symbol.gif
MATLAB 2009a Class Property Attributes
Green carrot left.gif
Classdef Method Attributes
Green carrot.jpg
In order to prevent spam, users must register before they can edit or create articles.


1 Introduction to MATLAB 2009a Class Property Attributes

Classes in MATLAB 2009a can have several properties. After the classdef command line you must define your class properties. All available attributes are listed in the properties table.

1.1 Example Property Definitions

Most properties will likely be public and public properties are defined in the following way:

 classdef ...
   % Public
   properties
     ...
   end

For hidden properties you define the block like this:

 classdef ...
   % Public
   properties
     ...
   end
   
   % Hidden
   properties (Hidden)
     ...
   end

See the psdData Class Example for more information.

2 Table of Class Property Attributes[1]

Attribute Name

Class

Description

Abstract

logical

default = false

If true, the property has no implementation, but a concrete subclass must redefine this property without Abstract being set to true.
  • Abstract properties cannot define set or get access methods. See Controlling Property Access.

  • Abstract properties cannot define initial values. See Assigning an Initial Value.

  • All subclasses must specify the same values as the superclass for the property SetAccess and GetAccess attributes.

  • Abstract=true should be used with the class attribute Sealed=false (the default).

Constant

logical

default = false

Set to true if you want only one value for this property in all instances of the class:

  • Subclasses inherit constant properties, but cannot change them.

  • Constant properties cannot be Dependent.

  • SetAccess is ignored.

Dependent

logical

default = false

If false, property value is stored in object. If true, property value is not stored in object and the set and get functions cannot access the property by indexing into the object using the property name.

GetAccess

char

default = public

public — unrestricted access

protected -- access from class or derived classes

private — access by class members only

GetObservable

logical

default = false

If true, and it is a handle class property, then listeners can be created for access to this property. The listeners are called whenever property values are queried. See Property-Set and Query Events

Hidden

logical

default = false

Determines whether the property should be shown in a property list (e.g., Property Inspector, call to set or get, etc.).

SetAccess

char

default = public

public — unrestricted access

protected -- access from class or derived classes

private — access by class members only

SetObservable

logical

default = false

If true, and it is a handle class property, then listeners can be created for access to this property. The listeners are called whenever property values are modified. See Property-Set and Query Events

Transient

logical

default = false

If true, property value is not saved when object is saved to a file. See Saving and Loading Objects for more about saving objects.

3 References

MATLAB 2009a Help

3.1 Notes

  1. Property Attributes


4 MATLAB Related Books