matlab.io.datastore.SimulationDatastore class
Package: matlab.io.datastore
Datastore for inputs and outputs of Simulink models
Description
A matlab.io.datastore.SimulationDatastore
object
enables a Simulink® model to interact with big data. You can load
big data as simulation input and log big output data from a simulation.
To simulate models with big data, you store the data in a MAT-file
and refer to the data through a SimulationDatastore
object.
See Work with Big Data for Simulations.
A SimulationDatastore
object refers to big simulation data
(which a MAT-file stores) for one signal. If the MAT-file stores simulation data for a
bus signal, a SimulationDatastore
object refers to the
data for one leaf signal element in the bus. You can use the datastore object to inspect
and access the data and, through a parent object such as Simulink.SimulationData.Signal
, simulate a Simulink model with the data.
To analyze the datastore data, you can use the methods and properties
of the SimulationDatastore
object as well as MATLAB® tools
such as the tall
function.
For more information about the MATLAB tools, see Getting Started with Datastore.
Construction
After you store big simulation data in a Simulink.SimulationData.Dataset
object
in a MAT-file, a signal element in the Dataset
object
points to the big data. To create a matlab.io.datastore.SimulationDatastore
object
that refers to the big data:
At the command prompt or in a script, create a
Simulink.SimulationData.DatasetRef
object that refers to theDataset
object in the MAT-file.Use one of these techniques:
Use one-based, curly-brace indexing (for example,
{1}
) to return an object that represents the target signal element, such asSimulink.SimulationData.Signal
orSimulink.SimulationData.State
. For example, for aDatasetRef
object namedlogsout_ref
, to create aSignal
object that refers to the second signal element, use this code:myLoggedSig = logsout_ref{2}
Use the
getAsDatastore
method of theDatasetRef
object to return an object that represents the target signal element. For more information, seegetAsDatastore
.
The SimulationDatastore
object resides in the Values
property
of the returned object.
Properties
Methods
hasdata | Determine if data is available to read |
isPartitionable | Determine whether datastore is partitionable |
isShuffleable | Determine whether datastore is shuffleable |
preview | Return subset of data from datastore |
progress | Return percentage of data that you have read from a datastore |
read | Read data in datastore |
readall | Read all data in datastore |
reset | Reset datastore to initial state |
Copy Semantics
Handle. To learn how handle classes affect copy operations, see Copying Objects.
Limitations
SimulationDatastore
does not support using a parallel pool with Parallel Computing Toolbox™ installed. To analyze data using tall arrays or run MapReduce algorithms, set the global execution environment to be the local MATLAB session usingmapreducer
. Enter this code:For information about controlling parallel resources, see Run mapreduce on a Parallel Pool (Parallel Computing Toolbox).mapreducer(0)
You cannot use a MATLAB tall variable as simulation input data.
Examples
Version History
Introduced in R2017a