MATLAB Object-Oriented Programming

(Joyce) #1

Find Handle Objects and Properties


In this section...
“Find Handle Objects” on page 7-26
“Find Handle Object Properties” on page 7-26

Find Handle Objects


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

function HM = findobj(H,<conditions>)

The findobj method returns an array of handles matching the conditions specified. You
can use regular expressions with findobj. For more information, see regexp.

Find Handle Object Properties


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

function mp = findprop(h,'PropertyName')

The property can also be a dynamic property created by the addprop method of the
dynamicprops class.

Use the returned meta.property object to obtain information about the property, such
as the settings of any of its attributes. For example, the following statements determine
that the setting of the AccountStatus property Dependent attribute is false.

ba = BankAccount(007,50,'open');
mp = findprop(ba,'AccountStatus');
mp.Dependent

ans =
0

See Also
handle

7 Value or Handle Class — Which to Use

Free download pdf