Main Content

getUniqueValues

Get unique values from fixed.DataGenerator object

Since R2019b

Description

example

data = getUniqueValues(datagenerator) returns all unique values in the data generated by the fixed.DataGenerator object, datagenerator.

Examples

collapse all

In data generated from a fixed.DataGenerator object, there can be repeated values. Use the getUniqueValues function to get all of the unique values in the data set.

dataspec = fixed.DataSpecification('fixdt(1,16,13)',...
 'Intervals', {-1,1})
dataspec = 

  fixed.DataSpecification with properties:

          DataTypeStr: 'sfix16_En13'
            Intervals: [-1,1]
      MandatoryValues: <empty>
           Complexity: 'real'
           Dimensions: 1
datagen = fixed.DataGenerator('DataSpecifications', dataspec,...
 'NumDataPointsLimit', 20);
getUniqueValues(datagen)
ans = 

   -1.0000
   -0.9999
   -0.4999
   -0.2500
   -0.0624
   -0.0313
   -0.0039
   -0.0021
   -0.0005
   -0.0002
         0
    0.0010
    0.0018
    0.0078
    0.0155
    0.0157
    0.1249
    0.1251
    0.9999
    1.0000

          DataTypeMode: Fixed-point: binary point scaling
            Signedness: Signed
            WordLength: 16
        FractionLength: 13

Input Arguments

collapse all

Input fixed.DataGenerator object to get unique values from.

Output Arguments

collapse all

Unique set of data generated by the input fixed.DataGenerator object, returned as a scalar, vector, or matrix.

Version History

Introduced in R2019b