Package: matlab.unittest.constraints
Comparator for MATLAB or Java objects
ObjectComparator
creates a comparator for MATLAB® or Java® objects. The comparator is satisfied if isequaln
returns true
. However, if the class of the expected value defines an isequal
method, whether visible or hidden, but not an isequaln
method, the ObjectComparator
uses that method for comparison instead of isequaln
.
ObjectComparator('Within',
creates a comparator using a specified tolerance. tolObj
)ObjectComparator
first checks that a call to isequaln
or isequal
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.