Package: matlab.unittest.constraints
Comparator for MATLAB or Java objects
ObjectComparator
creates
a comparator for MATLAB® or Java® objects. The comparator
is satisfied if the built-in isequal
function
returns true
. However, if the class of the expected
value defines an isequaln
method, the ObjectComparator
uses
that method for comparison instead of isequal
.
ObjectComparator('Within',
creates
a comparator using a specified tolerance. tolObj
)ObjectComparator
first
checks that a call to isequal
or isequaln
returns true
.
If the check fails, the ObjectComparator
checks for
equivalent class, size, and sparsity of the actual and expected values.
If these checks pass, ObjectComparator
delegates comparison
to the supplied tolerance, tolObj
. The value of
this tolerance must be of the same class as the actual and expected
values.
|
|
|
Specific tolerance used in construction of the comparator, specified
as a |
Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB documentation.