Package: Simulink.SimulationData
Superclasses:
Create Simulink.SimulationData.Dataset object
Simulink® creates Simulink.SimulationData.Dataset
objects
to store data elements when:
Performing signal logging, which use the Dataset
format
Logging states or outputs, if you use the default
format of Dataset
.
Logging a data store
Using the Dataset
format for state
and output logging offers several advantages compared to Array
, Structure
,
or Structure with time
. For details, see Format for State Information Saved Without Operating Point.
To generate a Simulink.SimulationData.Dataset
object from the root-level
Inport blocks in a model, you can use the createInputDataset
function. Signals in the generated dataset have the
properties of the Inport blocks and the corresponding ground values at
model start and stop times. You can create timeseries
and
timetable
objects for the time and values for signals for which
you want to load data for simulation. The other signals use ground values.
You can use curly braces ({}
) to streamline indexing syntax to access, set,
and add elements in a dataset, instead of using get
,
getElement
, setElement
, or
addElement
methods. To get or set an element using curly braces,
the index must be a scalar that is not greater than the number of elements in the
dataset variable. To add an element, the index must be a scalar that is greater than the
total number of elements in the dataset by one. The get
,
getElement
, setElement
, or
addElement
methods support specifying an element by name or block
path, as well as by index.
For individual non-bus signal data, you can specify these types of data for
Dataset
elements:
timeseries
timetable
matlab.io.datastore.SimulationDatastore
double
vectors or structure of double
data
timeseries
a Simulink.SimulationData.Signal
,
Simulink.SimulationData.State
, or
Simulink.SimulationData.DataStoreMemory
object
For bus signals, use a structure with a data element for each leaf signal, using one of these formats:
A MATLAB®
timeseries
object
A MATLAB
timetable
object
A matlab.io.datastore.SimulationDatastore
object
An empty matrix
An array that meets one of these requirements:
An array with time in the first column and the remaining columns each corresponding to an input port. See Loading Data Arrays to Root-Level Inputs.
An nx1
array for a root inport that drives a
function-call subsystem.
Another structure, with data elements for each signal that are consistent with these requirements for a structure for bus data
Variable-size signals are not supported for Dataset
data
values.
converts the convertedDataset
= Simulink.SimulationData.Dataset(loggedDataToConvert
)loggedDataToConvert
to a Simulink.SimulationData.Dataset
object.
You can then use the concat
method
to combine elements of two Dataset
objects.
constructs a constructedDataset
= Simulink.SimulationData.Dataset(variableName
,'DatasetName','dsname')Simulink.SimulationData.Dataset
object,
adds variable variableName
, and names the data
set dsname
.
Specify optional
comma-separated pairs of Name,Value
arguments. Name
is
the argument name and Value
is the corresponding value.
Name
must appear inside quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN
.
'DatasetName','dsname'
addElement | Add element to end of a Dataset object |
concat | Concatenate dataset to another dataset |
exportToPreviousRelease | Save a Dataset object to a MAT-file you can open in any
release |
find | Get element or collection of elements from dataset |
get | Get element or collection of elements from dataset |
getElementNames | Return names of all elements in dataset |
numElements | Get number of elements in data set |
plot | Plot data in the Simulation Data Inspector |
setElement | Change element stored at specified index |
Tip
To get the names of Dataset
variables in
the MAT-file, using the
function
processes faster than using the Simulink.SimulationData.DatasetRef.getDatasetVariableNames
who
or whos
functions.
Value. To learn how value classes affect copy operations, see Copying Objects.
|
addElement
| concat
| createInputDataset
| get
| getElementNames
| loadIntoMemory
| numElements
| plot
| setElement
| Simulink.ModelDataLogs
| Simulink.SimulationData.DatasetRef
| Simulink.SimulationData.DatasetRef.getDatasetVariableNames
| Simulink.SimulationData.DataStoreMemory
| Simulink.SimulationData.Signal