MATLAB Object-Oriented Programming

(Joyce) #1
methods('handle')

Methods for class handle:

addlistener findobj gt lt
delete findprop isvalid ne
eq ge le notify

Event and Listener Methods


For information on how to use the notify and addlistener methods, see “Events and
Listeners Syntax” on page 11-22.

Relational Methods


TF = eq(H1,H2)
TF = ne(H1,H2)
TF = lt(H1,H2)
TF = le(H1,H2)
TF = gt(H1,H2)
TF = ge(H1,H2)

The handle class overloads these functions to support equality tests and sorting on
handles. For each pair of input arrays, these functions return a logical array of the same
size. Each element is an element-wise equality or comparison test result. The input arrays
must be the same size or one (or both) can be scalar. The method performs scalar
expansion as required. For more information on handle class relational methods, see
relationaloperators.

Test Handle Validity


Use the isvalid handle class method to determine if a variable is a valid handle object.
For example, in the statement:

B = isvalid(H)

B is a logical array in which each element is true if, and only if, the corresponding
element of H is a valid handle. B is always the same size as H.

7 Value or Handle Class — Which to Use

Free download pdf