Main Content

fixed.DataGenerator

Creates value set and generates data

Description

Use the fixed.DataSpecification and fixed.DataGenerator objects to generate simulation inputs to test the full operating range of your designs.

Creation

Description

data = fixed.DataGenerator(Name, Value) creates a DataGenerator object with additional properties specified as Name, Value pair arguments.

example

Properties

expand all

Properties of the data to generate, specified as a fixed.DataSpecification object.

Specifying a cell array of DataSpecification objects produces a single DataGenerator object for input to a system with the same number of inputs and in the same order as elements in the cell array.

Maximum number of data points in generated data, specified as an integer-valued scalar. For more information, see getNumDataPointsInfo.

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

Object Functions

getUniqueValuesGet unique values from fixed.DataGenerator object
getNumDataPointsInfoGet information about number of data points in generated data
outputAllDataGet data from fixed.DataGenerator object

Examples

collapse all

Create a DataGenerator object by specifying a DataSpecification object in the constructor.

Create the DataSpecification object with an interval from -2π to 2π with a data type of single.

dataspec = fixed.DataSpecification('single',...
    'Intervals',{-2*pi, 2*pi})
dataspec = 
  fixed.DataSpecification with properties:

          DataTypeStr: 'single'
            Intervals: [-6.2832,6.2832]
     ExcludeDenormals: false
  ExcludeNegativeZero: false
      MandatoryValues: <empty>
           Complexity: 'real'
           Dimensions: 1

Use the DataSpecification object to create a DataGenerator object. Limit the number of data points in the generated data to 5000 points. You can specify these properties as name-value pairs in the constructor of the DataGenerator object.

datagen = fixed.DataGenerator('DataSpecifications',dataspec,...
    'NumDataPointsLimit',5000)
datagen = 
  fixed.DataGenerator with properties:

    DataSpecifications: {[1x1 fixed.DataSpecification]}
    NumDataPointsLimit: 5000

Use the outputAllData function to see the generated data.

myData = outputAllData(datagen);

Algorithms

expand all

Version History

Introduced in R2019b