Documentation class


Datastore for Simulation Data Inspector signals


A object enables the Simulation Data Inspector to interact with large sets of data that are too large to fit in memory. An sdidatastore object references the data for one signal.


ds_element = dsrObj.getAsDatastore(arg) creates the sdidatastore, ds_element, for the signal in the Simulink.sdi.Datasetref object selected by the search criterion arg.

ds_element = creates the sdidatastore, ds_element for the signal specified by signalID.

Input Arguments

expand all

Search criterion used to retrieve the element from the Simulink.sdi.DatasetRefobject. For name based searches, specify arg as a character vector. For index based searches, arg is an integer, representing the index of the desired element.

Example: 'MySignal'

Example: 3

Unique number identifying a signal.


expand all

Name of the signal specified as a character vector.

Example: 'My Signal'

Simulink.sdi.Signal object associated with the sdidatastore.


Inherited Methods

hasdataDetermine if data is available to read
previewReturn subset of data from datastore
progressReturn percentage of data that you have read from a datastore
readRead data in datastore
readallRead all data in datastore
resetReset datastore to initial state

Copy Semantics

Handle. To learn how handle classes affect copy operations, see Copying Objects (MATLAB).


expand all

This example shows how to create a sdidatastore object for a signal in a Simulink.sdi.DatasetRef object.

% Simulate model sldemo_fuelsys to create a run of logged signals

% Get the runID
runIDs = Simulink.sdi.getAllRunIDs;
runID = runIDs(end);

% Get the run object
run = Simulink.sdi.getRun(runID);

% Make a Simulink.sdi.DatasetRef object
run_DSRef = run.getDatasetRef;

% Get the names of the elements in the object
names = run_DSRef.getElementNames
names =

  10×1 cell array

    {'EGO Fault Switch:1'           }
    {'air_fuel_ratio'               }
    {'Engine Speed Fault Switch:1'  }
    {'speed'                        }
    {'MAP Fault Switch:1'           }
    {'map'                          }
    {'ego'                          }
    {'Throttle Angle Fault Switch:1'}
    {'throttle'                     }
    {'fuel'                         }

% Get sdidatastore object for fuel signal
fuel_ds = run_DSRef.getAsDatastore(10);

Introduced in R2017b

Was this topic helpful?