Finding Handle Objects and Properties

Finding Handle Objects

The findobj method enables you to locate handle objects that meet certain conditions.

function HM = findobj(H,) 

The findobj method returns an array of handles matching the conditions specified.

Finding Handle Object Properties

The findprop method returns the object for the specified object and property.

function mp = findprop(h,'PropertyName') 

The findprop method returns the object associated with the PropertyName property defined by the class of h. The property can also be a dynamic property created by the addprop method of the dynamicprops class.

You can use the returned object to obtain information about the property, such as querying the settings of any of its attributes. For example, the following statements determine that the setting of the AccountStatus property’s Dependent attribute is false.

ba = BankAccount(007,50,'open');
mp = findprop(ba,'AccountStatus'); % get object
ans =

Working with Meta-Classes provides more information on meta-classes.

You may also like...