Simulink.sdi.createRun
Import 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. Set the properties on the Run
object to
add metadata to the run. Use the Simulink.sdi.addToRun
function
or the add
function to add data to the run.
Import Data from Workspace
imports data from one or more variables into a new run in the Simulation Data
Inspector named runID
= Simulink.sdi.createRun(runName
,"vars",var
,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, or an 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
Output Arguments
Version History
Introduced in R2011b
See Also
Objects
Functions
Simulink.sdi.getRun
|Simulink.sdi.addToRun
|Simulink.sdi.createRunOrAddToStreamedRun
|io.reader.getRegisteredFileReaders
|io.reader.getSupportedReadersForFile
|Simulink.sdi.Run.create