Simulink.sdi.createRun
R2026bImport data into new run in Simulation Data Inspector and return run ID
Syntax
Description
Create Empty Run
creates an empty, unnamed run in the Simulation Data Inspector and returns the
run ID for the created run. runID = Simulink.sdi.createRun
You can use the Simulink.sdi.getRun function to
access the Simulink.sdi.Run object that
corresponds to the run. To add metadata to the run, set the properties on the
Run object. Use the Simulink.sdi.addToRun function
or the add function to add data to the run.
Import Data from Workspace
imports data from the scalar variable runID = Simulink.sdi.createRun(var)var into a new run in
the Simulation Data Inspector. The function names the run according to the input variable.
For example, when var is a timeseries
object, the run name comes from the Name property on the
timeseries object.
imports data from one or more variables into a new run in the Simulation Data
Inspector named runID = Simulink.sdi.createRun(runName,"vars",var1,var2,...,varn)runName.
Use this syntax to import data from multiple variables or from a variable that
represents an array of objects, such as an array of Simulink.SimulationOutput or
Simulink.SimulationData.Dataset
objects.
imports data from one or more variables into a new run in the Simulation Data
Inspector named runID = Simulink.sdi.createRun(runName,"namevalue",sourceNames,sigValues)runName. The cell array
sourceNames specifies the names used to set the
RootSource, TimeSource, and
DataSource properties for the signals imported from the
sigValues cell array.
Import Data from File
imports data from a file into a new run in the Simulation Data Inspector. 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.runID = Simulink.sdi.createRun(runName,"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 a new run in the Simulation Data Inspector
according to options specified using one or more name-value arguments. For
example, runID = Simulink.sdi.createRun(runName,"file",filename,Name=Value)sheets=["sheet1" "sheet2"] specifies the sheets from
which to import data when importing data from an Excel file.
Return Additional Run Information
Examples
Input Arguments
Name-Value Arguments
Output Arguments
Version History
Introduced in R2011bSee Also
Objects
Functions
Simulink.sdi.getRun|Simulink.sdi.addToRun|Simulink.sdi.createRunOrAddToStreamedRun|io.reader.getRegisteredFileReaders|io.reader.getSupportedReadersForFile|Simulink.sdi.Run.create