Main Content

outputAllData

Get data from fixed.DataGenerator object

Description

data = outputAllData(datagenerator) returns the data generated by the fixed.DataGenerator object, datagenerator.

example

data = outputAllData(datagenerator, format) returns the data generated by the fixed.DataGenerator object, datagenerator, in the format specified by format.

Examples

collapse all

Get the data from a fixed.DataGenerator object, returned as an array of values.

dataspec = fixed.DataSpecification('int8', 'Intervals', {-1,1});
datagen = fixed.DataGenerator('DataSpecifications', dataspec,...
 'NumDataPointsLimit', 20)
datagen = 

  fixed.DataGenerator with properties:

    DataSpecifications: {[1×1 fixed.DataSpecification]}
    NumDataPointsLimit: 20

Use the outputAllData function to access the data in the DataGenerator object.

data = outputAllData(datagen)
data =

  1×3 int8 row vector

   -1    0    1

The function returns the data in an array with the type specified by the fixed.DataSpecification object.

Get the data from a fixed.DataGenerator object, returned as a timeseries object.

dataspec = fixed.DataSpecification('int8', 'Intervals', {-1,1});
datagen = fixed.DataGenerator('DataSpecifications', dataspec,...
 'NumDataPointsLimit', 2000)
datagen = 

  fixed.DataGenerator with properties:

    DataSpecifications: {[1×1 fixed.DataSpecification]}
    NumDataPointsLimit: 20000

Specify the format of the output type to get a timeseries object.

data = outputAllData(datagen, 'timeseries')
  timeseries

  Common Properties:
            Name: 'unnamed'
            Time: [3x1 double]
        TimeInfo: [1x1 tsdata.timemetadata]
            Data: [3x1 int8]
        DataInfo: [1x1 tsdata.datametadata]

Input Arguments

collapse all

Object from which you want to get data, specified as a fixed.DataGenerator object.

Format in which you want data returned, specified as either 'array', 'timeseries', or 'dataset'.

Specifying 'dataset' returns a Simulink.SimulationData.Dataset object. Specifying 'timeseries' returns a timeseries object.

Example: data = outputAllData(datagen, 'timeseries');

Data Types: char

Output Arguments

collapse all

Data from the DataGenerator object, returned as either a scalar, vector, matrix, or timeseries object.

Version History

Introduced in R2019b