Main Content
matlab.unittest.constraints.HasUniqueElements Class
Namespace: matlab.unittest.constraints
Superclasses: matlab.unittest.constraints.BooleanConstraint
Test if set has unique elements
Description
The matlab.unittest.constraints.HasUniqueElements
class provides a
constraint to test if a set has unique elements.
The constraint uses the unique
function to analyze the set. So, the
actual value you use with the constraint must be supported by the unique
function.
Creation
Description
c = matlab.unittest.constraints.HasUniqueElements
creates a constraint to test if a set has unique elements. For an actual set
actual
, the constraint is satisfied if
numel(unique(actual))
is equal to
numel(actual)
.
Examples
Version History
Introduced in R2016a