Skip to Main Content Skip to Search
Product Documentation

addprop (dynamicprops) - Add dynamic property

Syntax

P = addprop(Hobj,'PropName')

Description

P = addprop(Hobj,'PropName') adds a property named PropName to each object in array Hobj. The class definition is not affected by the addition of dynamic properties. Note that you can add dynamic properties only to objects derived from the dynamicprops class. You can set and retrieve the data in dynamic properties as you would any property.

The output argument P is an array the same size as Hobj of meta.DynamicProperty objects, which you can use to assign SetMethod and GetMethod functions to the property. These functions operate just like property set and get access methods.

See Dynamic Properties — Adding Properties to an Instance for more information and examples.

See Also

dynamicprops | handle

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS