getElement
Copy signal data from Simulation Data Inspector run to workspace
Syntax
Description
[
copies data for the signal with the index element, name, idx] = getElement(dsr,searchIdx)searchIdx within the
Simulation Data Inspector run referenced by the
Simulink.SimulationData.DatasetRef object
dsr into the variable element in the
workspace.
Use the getElement function to work with a copy of data for a
signal in the Simulation Data Inspector in the workspace. The function loads the
data for the signal into memory. Simulation data logs to a temporary file on disk.
The Simulation Data Inspector accesses data in the temporary file, loading data into
memory only as needed.
A Simulink.sdi.DatasetRef object references the data for a run in the
Simulation Data Inspector, allowing you to work with signal data in the run while
controlling when and how the signal data is loaded into memory. To access signal
data in the repository without loading the signal data into memory, use the
getSignal function.
[
copies data for the signal element, name, idx] = getElement(dsr,searchName)searchName into the workspace variable
element.
If only one signal has the name
searchName, the function returns the data to the workspace as a scalar object matching the way the data is logged to the workspace inDatasetformat.If multiple signals have the name
searchName, the function returns aDatasetobject that contains those elements.If
searchNameis a cell array containing one character vector, the function returns aDatasetobject containing the signal data for one or more signals corresponding to the namesearchName.
Examples
Input Arguments
Output Arguments
Alternatives
To access signal data in the repository without loading the signal data into memory,
use the getSignal function.
Version History
Introduced in R2017b