Add dynamic property
P = addprop(Hobj,'PropName')
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.