Main Content

fixed.DataGenerator

Creates value set and generates data

Description

Use thefixed.DataSpecificationandfixed.DataGenerator对象to generate simulation inputs to test the full operating range of your designs.

Creation

Description

example

data= fixed.DataGenerator(Name, Value)creates aDataGeneratorobject with additional properties specified asName, Valuepair arguments.

Properties

expand all

Properties of the data to generate, specified as afixed.DataSpecificationobject.

Specifying a cell array ofDataSpecification对象produces a singleDataGeneratorobject 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, seegetNumDataPointsInfo.

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

Object Functions

getUniqueValues Get unique values fromfixed.DataGeneratorobject
getNumDataPointsInfo Get information about number of data points in generated data
outputAllData Get data fromfixed.DataGeneratorobject

例子

collapse all

创建一个DataGeneratorobject by specifying aDataSpecificationobject in the constructor.

Create theDataSpecification对象与一个国际米兰val from - 2 π to 2 π with a data type ofsingle.

dataspec =固定。DataSpecification ('single','Intervals', {-2*pi, 2*pi})
dataspec =固定。DataSpecification with properties: DataTypeStr: 'single' Intervals: [-6.2832,6.2832] ExcludeDenormals: false ExcludeNegativeZero: false MandatoryValues:  Complexity: 'real' Dimensions: 1

Use theDataSpecificationobject to create aDataGeneratorobject. 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 theDataGeneratorobject.

datagen = fixed.DataGenerator('DataSpecifications', dataspec,'NumDataPointsLimit', 5000)
datagen = fixed.DataGenerator with properties: DataSpecifications: {[1x1 fixed.DataSpecification]} NumDataPointsLimit: 5000

Use theoutputAllDatafunction to see the generated data.

myData = outputAllData(datagen)
myData =1x262 single row vector-6.2832 -6.2832 -4.0000 -4.0000 -4.0000 -2.0000 -2.0000 -2.0000 -1.0000 -1.0000 -1.0000 -0.5000 -0.5000 -0.5000 -0.2500 -0.2500 -0.2500 -0.1250 -0.1250 -0.1250 -0.0625 -0.0625 -0.0625 -0.0313 -0.0312 -0.0156 -0.0078 -0.0078 -0.0078 -0.0039 -0.0039 -0.0039 -0.0020 -0.0020 -0.0001 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000

Algorithms

expand all

Version History

Introduced in R2019b