| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
The meta.DynamicProperty class contains descriptive information about dynamic properties that you have added to an instance of a MATLAB classes. The MATLAB class must be a subclass of dynamicprops. The properties of the meta.DynamicProperty class correspond to property attributes that you specify from within class definitions. Dynamic properties are not defined in classdef blocks, but you can set their attributes by setting the meta.DynamicProperty object properties.
You add a dynamic property to an object using the addprop method of the dynamicprops class. The addprop method returns a meta.DynamicProperty instance representing the new dynamic property. You can modify the properties of the meta.DynamicProperty object to set the attributes of the dynamic property or to add set and get access methods, which would be defined in the classdef for regular properties.
You cannot instantiate the meta.DynamicProperty class. You must use addprop to obtain a meta.DynamicProperty object.
To remove the dynamic property, call the delete handle class method on the meta.DynamicProperty object.
Obtain a meta.DynamicProperty object from the addprops method, which returns an array of meta.DynamicProperty objects, one for each dynamic property.
See Dynamic Properties — Adding Properties to an Instance for more information.
| Property | Purpose |
|---|---|
| Name | Name of the property. |
| Description | Can contain text |
| DetailedDescription | Can contain text |
| Abstract attribute, default = false | If true, the property has no implementation,
but a concrete subclass must redefine this property without Abstract being
set to true.
|
| constant attribute, default = false | Set to true if you want only one value for this property in all instances of the class.
|
| GetAccess attribute, default = public | public – unrestricted access protected – access from class or derived classes private – access by class members only |
| SetAccess attribute, default = public | public – unrestricted access protected – access from class or derived classes private – access by class members only |
| Dependent attribute, 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. |
| Transient attribute, default = false | If true, property value is not saved when object is saved to a file. See The Save and Load Process for more about saving objects. |
| Hidden attribute, default = false | Determines whether the property should be shown in a property list (e.g., Property Inspector, call to properties, etc.). |
| GetObservable attribute, 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 |
| SetObservable attribute, 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 |
| GetMethod | Function handle of the get method associated with this property. Empty if there is no get method specified. See Property Get Method |
| SetMethod | Function handle of the set method associated with this property. Empty if there is no set method specified. See Property Set Methods |
| DefiningClass | The meta.class object representing the class that defines this property. |
See Listening for Changes to Property Values for information on using property events.
| Event Name | Purpose |
|---|---|
| PreGet | Event occurs just before property is queried. |
| PostGet | Event occurs just after property has been queried |
| PreSet | Event occurs just before this property is modified |
| PostSet | Event occurs just after this property has been modified |
| ObjectBeingDestroyed | Inherited from handle |
![]() | meta.class.fromName | meta.event | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |