Main Content

Find Handle Objects and Properties

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 matlab.metadata.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 matlab.metadata.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

Related Topics