Package: matlab.unittest.constraints
Superclasses: matlab.unittest.constraints.Tolerance
Absolute numeric tolerance
This numeric Tolerance
assesses the magnitude
of the difference between actual and expected values. For the tolerance
to be satisfied, abs(expVal - actVal) <= absTol
must
be true.
AbsoluteTolerance(tolVals)
creates
an absolute tolerance object that assesses the magnitude of the difference
between the actual and expected values.
The data types of the inputs to the AbsoluteTolerance
constructor
determines which data types the tolerance supports. For example, AbsoluteTolerance(10*eps)
constructs
an AbsoluteTolerance
for comparing double-precision
numeric arrays, while AbsoluteTolerance(int8(2))
constructs
an AbsoluteTolerance
for comparing numeric arrays of
type int8
. If the actual and expected values being
compared contain more than one numeric data type, the tolerance only
applies to the data types specified by the values passed into the
constructor.
To specify different tolerance values for different data types,
you can pass multiple tolerance values to the constructor. For example, AbsoluteTolerance(10*eps,
10*eps('single'), int8(1))
constructs an AbsoluteTolerance
object
applies the following absolute tolerances:
10*eps
applies an absolute tolerance
of 10*eps
for double-precision numeric arrays.
10*eps('single')
applies an absolute
tolerance of 10*eps
for single-precision numeric
arrays.
int8(1)
applies an absolute tolerance
of 1
for numeric arrays of type int8
.
You can specify more than one tolerance for a particular data
type by combining tolerances with the &
and |
operators.
To combine two tolerances, the sizes of the tolerance values for each
data type must be compatible.
|
Numeric tolerances, specified as a comma-separated list of numeric arrays. Each input argument contains the tolerance specification for a particular data type. Each numeric array can be a scalar or array the same size as the actual and expected values. |
|
Numeric tolerances, specified by the |
Value. To learn how value classes affect copy operations, see Copying Objects.