handle.relationaloperators - Determine equality or sort handle objects - MATLAB (original) (raw)

Main Content

Class: handle

Determine equality or sort handle objects

Syntax

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

Description

[tf](#bul5gla-tf) = eq([H1](#bul5gla-H1),[H2](#bul5gla-H2)) Equal. (H1 == H2)

[tf](#bul5gla-tf) = ne([H1](#bul5gla-H1),[H2](#bul5gla-H2)) Not equal. (H1 ~= H2)

[tf](#bul5gla-tf) = lt([H1](#bul5gla-H1),[H2](#bul5gla-H2)) Less than. (H1 < H2)

[tf](#bul5gla-tf) = le([H1](#bul5gla-H1),[H2](#bul5gla-H2)) Less than or equal. (H1 <= H2)

[tf](#bul5gla-tf) = gt([H1](#bul5gla-H1),[H2](#bul5gla-H2)) Greater than. (H1 > H2)

[tf](#bul5gla-tf) = ge([H1](#bul5gla-H1),[H2](#bul5gla-H2)) Greater than or equal. (H1 >= H2)

For each pair of input arrays (H1 and H2), the operation returns a logical array of the same size. Each element in the returned array is an element-wise equality or comparison test result. These methods perform scalar expansion in the same way as the MATLAB® built-in relational operators. For general information on relational operators, see Relational Operations.

The following guidelines apply to handle comparison:

Use isequal when you want to determine if different handle objects have the same data in all object properties. Use == when you want to determine if handle variables refer to the same object.

When comparing objects that contain dynamic properties, isequal always returns false.

Input Arguments

expand all

Left argument to operator, specified as a handle array.

Right argument to operator, specified as a handle array.

Output Arguments

expand all

Result of comparison, returned as a logical array of the same size as the input arrays, where each element is an element-wise equality or comparison test result