Simulink.sdi.addToRun
R2026bImport 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 run
specified by sigIDs = Simulink.sdi.addToRun(runID,"vars",var1,var2,...,varn)runID.
To import data into a new run, use Simulink.sdi.Run.create or Simulink.sdi.createRun.
specifies values to use for the sigIDs = Simulink.sdi.addToRun(runID,"namevalue",sourceNames,sigValues)RootSource,
TimeSource, and DataSource
metadata properties of signals imported into the Simulation Data Inspector
run.
Import Data from File
imports data from a file into the Simulation Data Inspector run specified by
sigIDs = Simulink.sdi.addToRun(runID,"file",filename)runID. You can use a built-in file reader to import data
from a MAT file, CSV file, Microsoft®
Excel® file, Parquet file (since R2026b), or MDF
file.
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.
specifies options when importing data from a file 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.