Access run signals and metadata
The Simulink.sdi.Run
object contains run metadata and
allows you to access the Simulink.sdi.Signal
objects that
contain data and metadata for the signals in the run. You can also use a
Simulink.sdi.Run
object to import data into the Simulation Data
Inspector from the workspace or a file.
The Simulation Data Inspector creates Simulink.sdi.Run
objects when
you import data or simulate a model that logs data. You can access a
Run
object in the Simulation Data Inspector three ways:
When you want to access a run that corresponds to a specific run ID, use
the Simulink.sdi.getRun
function.
Tip
Use the Simulink.sdi.getAllRunIDs
function to get the run
IDs for all the runs in the Simulation Data Inspector.
When you want to access the most recently created run in the Simulation
Data Inspector, use the Simulink.sdi.Run.getLatest
function.
When you want to access the run that corresponds to the in-progress or
most recently completed simulation of a model, use the Simulink.sdi.getCurrentSimulationRun
function.
You can also programmatically create a Simulink.sdi.Run
object to
import data into the Simulation Data Inspector.
Create an empty run in the Simulation Data Inspector using the Simulink.sdi.Run.create
function.
Create an empty run in the Simulation Data Inspector or import data into
the Simulation Data Inspector using the Simulink.sdi.createRun
.
Tip
Use the add
function or the Simulink.sdi.addToRun
function
to import data into an empty Run
object.
add | Add signals to Simulink.sdi.Run object |
export | Export run to base workspace or file |
getAllSignalIDs | Get all signal IDs for signals in Simulink.sdi.Run
object |
getAllSignals | Get all signals in Simulink.sdi.Run object |
getDatasetRef | Create a Simulink.sdi.DatasetRef object for a run |
getSignalByIndex | Get signal in Simulink.sdi.Run object by index |
getSignalIDByIndex | Get signal ID for signal at specified index in
Simulink.sdi.Run object |
getSignalIDsByName | Get signal IDs for signals inside Simulink.sdi.Run object using
signal name |
getSignalsByName | Access signals in a Simulink.sdi.Run object using signal
name |
isValidSignalID | Check whether signal ID corresponds to signal in
Simulink.sdi.Run object |
You can view run metadata and import data using the Simulation Data Inspector UI. For more information, see View Data in the Simulation Data Inspector.