matlab.io.datastore.SimulationDatastore class
Package:matlab.io.datastore
Datastore for inputs and outputs of金宝appmodels
Description
Amatlab.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 aSimulationDatastore
object. SeeWork with Big Data for Simulations.
ASimulationDatastore
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, aSimulationDatastore
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 asSimulink.SimulationData.Signal
, simulate a Simulink model with the data.
To analyze the datastore data, you can use the methods and properties of theSimulationDatastore
object as well as MATLAB®tools such as thetall
function. For more information about the MATLAB tools, seeGetting Started with Datastore.
Construction
After you store big simulation data in aSimulink.SimulationData.Dataset
object in a MAT-file, a signal element in theDataset
object points to the big data. To create amatlab.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
.
TheSimulationDatastore
object resides in theValues
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, seeCopying 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 usingmapreduce
. Enter this code:mapreduce(0)
You cannot use a MATLAB tall variable as simulation input data.