Main Content

contains

Determine whether value domain of a DataSpecification object contains a specified value

Description

bool = contains(dataspec, value) returns a boolean value indicating whether the value domain of the fixed.DataSpecification object, dataspec, contains the value, value.

example

Examples

collapse all

Use the contains function to determine whether a fixed.DataSpecification object contains a specified value.

dataspec = fixed.DataSpecification('int8', 'Intervals', {-1,1})
dataspec = 

  fixed.DataSpecification with properties:

          DataTypeStr: 'int8'
            Intervals: [-1,1]
      MandatoryValues: <empty>
           Complexity: 'real'
           Dimensions: 1

Determine whether dataspec contains the value 0.

bool = contains(dataspec, 0)
bool =

  logical

   1

Input Arguments

collapse all

Input fixed.DataSpecification object.

Value or values to check for in the fixed.DataSpecification object, specified as a scalar, or vector.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fi

Output Arguments

collapse all

Whether the fixed.DataSpecification object contains the value, returned as a boolean value.

If the value argument is a vector, the output is a boolean vector of the same length.

Version History

Introduced in R2019b