Superclass for classes that support dynamic properties
dynamicprops is an abstract class derived from the
handle class. Subclass
dynamicprops to define classes
that support dynamic properties.
Dynamic properties are associated with a specific object of the class, but are not part of the class definition. Use dynamic properties to attach temporary data to objects. For information on using dynamic properties, see Dynamic Properties — Adding Properties to an Instance.
isequal function always returns
false when comparing objects that have dynamic properties,
even if the properties have the same name and value. If you need to compare objects
that contain dynamic properties, overload
isequal as a method
of your class.
dynamicprops class is a
For information on class attributes, see Class Attributes.
Derive a class from the
classdef InstanceProperty < dynamicprops end
Add a property to an object of the class using the
and assign a value to the property.
obj = InstanceProperty; obj.addprop('NewProperty'); obj.NewProperty = 1:10
obj = InstanceProperty with properties: NewProperty: [1 2 3 4 5 6 7 8 9 10]
Introduced in R2008a