Package: matlab.io.datastore
Datastore for inputs and outputs of Simulink models
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.
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 the Dataset
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 as Simulink.SimulationData.Signal
or
Simulink.SimulationData.State
. For example, for a
DatasetRef
object named
logsout_ref
, to create a Signal
object that refers to the
second signal element, use this code:
myLoggedSig = logsout_ref{2}
Use the getAsDatastore
method
of the DatasetRef
object to return an object that
represents the target signal element. For more information, see getAsDatastore
.
The SimulationDatastore
object resides in the Values
property
of the returned object.
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 |
Handle. To learn how handle classes affect copy operations, see Copying Objects.
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
using mapreducer
. Enter this
code:
mapreducer(0)
You cannot use a MATLAB tall variable as simulation input data.