Simulink.sdi.addToRun
Import data into existing run in Simulation Data Inspector using run ID
Syntax
Description
Import Data from Workspace
imports data from one or more variables into the Simulation Data Inspector by
adding one or more signals to the run that corresponds to the specified run
ID.sigIDs
= Simulink.sdi.addToRun(runID
,'vars'
,var
,var2,...,varn)
To import data into a new run, use the Simulink.sdi.Run.create
function or the Simulink.sdi.createRun
function.
imports data from one or more variables into the Simulation Data Inspector by
adding one or more signals to the run that corresponds to the specified run ID.
The sigIDs
= Simulink.sdi.addToRun(runID
,'namevalue',sourceNames
,sigValues
)sourceNames
argument specifies values to use for the data
source in the metadata for the signals added to the run.
Import Data from File
imports data from a file into the Simulation Data Inspector by adding one or
more signals to the run that corresponds to the specified run ID. You can use a
built-in file reader to import data from a MAT file, CSV file, Microsoft®
Excel® file, or MDF file.sigIDs
= Simulink.sdi.addToRun(runID
,'file',filename
)
When you need to import data from a file that the built-in readers do not
support, you can write your own reader using the io.reader
class.
imports data from a file into the Simulation Data Inspector by adding one or
more signals to the run that corresponds to the specified run ID according to
options specified using one or more name-value arguments. For example,
sigIDs
= Simulink.sdi.addToRun(runID
,'file',filename
,Name=Value
)sheets=["sheet1" "sheet2"]
specifies the sheets from
which to import data when importing data from an Excel file.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2011b