creates value set and generates data -凯发k8网页登录
creates value set and generates data
since r2019b
description
use the and fixed.datagenerator
objects to
generate simulation inputs to test the full operating range of your designs.
creation
description
creates a data
= fixed.datagenerator(name, value
)datagenerator
object with additional properties specified as
name, value
pair arguments.
properties
dataspecifications
— properties of generated data
fixed.dataspecification
object | cell array of fixed.dataspecification
objects
properties of the data to generate, specified as a 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.
numdatapointslimit
— maximum number of data points in generated data
100000 (default) | integer-valued scalar
maximum number of data points in generated data, specified as an integer-valued scalar. for more information, see .
data types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
object functions
get unique values from fixed.datagenerator object | |
get information about number of data points in generated data | |
get data from fixed.datagenerator object |
examples
create a fixed.datagenerator
object
create a datagenerator
object by specifying a dataspecification
object in the constructor.
create the dataspecification
object with an interval from to 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: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
data generation for one-dimensional, two-dimensional, and complex data
when you use a datagenerator
object to generate data for a
dataspecification
object with the dimensions
property
set to 1, the output data always contains the minimum and maximum values of the specified
intervals, and any values specified by the mandatoryvalues
property.
when you generate data for a dataspecification
object with the
dimensions
property set to a value greater than 1, the output is
generated by taking a cartesian product of the one-dimensional output.
for example, consider the following two dataspecification
objects. the
two objects are identical except that one is one-dimensional, and the other is
two-dimensional.
dataspec_1d = fixed.dataspecification('single',... 'intervals', {-1,1}, 'dimensions',1); dataspec_2d = fixed.dataspecification('single',... 'intervals', {-1,1}, 'dimensions',2);
datagenerator
objects based on these specifications. set the maximum
number of data points in the generated data to
inf
.datagen_1d = fixed.datagenerator('dataspecifications', ... dataspec_1d, 'numdatapointslimit', inf); datagen_2d = fixed.datagenerator('dataspecifications', ... dataspec_2d, 'numdatapointslimit', inf);
get the size of the generated data for each of the configurations.
size_1d_data = size(outputalldata(datagen_1d)) size_2d_data = size(outputalldata(datagen_2d))
size_1d_data = 1 244
size_2d_data = 2 59536
the datagenerator
generates complex data in a similar way to the
two-dimensional data. create a dataspecification
object with
dimensions
set to 1
and the
complexity
set to complex
. create a
datagenerator
object using this
specification.
dataspec_complex = fixed.dataspecification('single', ... 'intervals', {-1,1}, 'dimensions', 1, 'complexity', 'complex');
datagen_complex = fixed.datagenerator('dataspecifications', ... dataspec_complex, 'numdatapointslimit', inf);
get the size of the generated data from this configuration.
size_complex_data = size(outputalldata(datagen_complex))
size_complex_data = 1 59536
the length of the output data for the one-dimensional complex data is the same as the length of the two-dimensional real data.
version history
introduced in r2019b
see also
objects
- |
打开示例
您曾对此示例进行过修改。是否要打开带有您的编辑的示例?
matlab 命令
您点击的链接对应于以下 matlab 命令:
请在 matlab 命令行窗口中直接输入以执行命令。web 浏览器不支持 matlab 命令。
select a web site
choose a web site to get translated content where available and see local events and offers. based on your location, we recommend that you select: .
you can also select a web site from the following list:
how to get best site performance
select the china site (in chinese or english) for best site performance. other mathworks country sites are not optimized for visits from your location.
americas
- (español)
- (english)
- (english)
europe
- (english)
- (english)
- (deutsch)
- (español)
- (english)
- (français)
- (english)
- (italiano)
- (english)
- (english)
- (english)
- (deutsch)
- (english)
- (english)
- switzerland
- (english)
asia pacific
- (english)
- (english)
- (english)
- 中国
- (日本語)
- (한국어)