Main Content


Delete signal in the Simulation Data Inspector



Simulink.sdi.deleteSignal(sigID) deletes the specified signal or signals from the Simulation Data Inspector.


collapse all

This example shows how to use Simulink.sdi.copyRun and Simulink.sdi.deleteSignal to create a copy of a run that contains a subset of the signals from the original run. You can use the copy to analyze and run comparisons on a subset of signals while still holding onto the original run that has all of the signals. For example, the model sldemo_fuelsys is configured to log ten signals. To compare the system's responses to different types of failures, you don't need to run the comparison on all of the logged signals. Deleting signals that do not represent the system's response before running the comparison saves processing time and simplifies the view of the results.

Create Runs

Load the model sldemo_fuelsys and run simulations to create runs in the Simulation Data Inspector. The first run simulates a failure of the throttle angle sensor, and the second run simulates a failure of the exhaust gas oxygen sensor.

modelWorkspace = get_param('sldemo_fuelsys','modelworkspace');


Copy the Run

Use the Simulation Data Inspector's programmatic interface to get Simulink.sdi.Run objects for the simulations, and then create copies of the runs.

% Get runs
runIDs = Simulink.sdi.getAllRunIDs;

runID1 = runIDs(end-1);
runID2 = runIDs(end);

run1 = Simulink.sdi.getRun(runID1);
run2 = Simulink.sdi.getRun(runID2);

% Create a copy of each run, truncRun
[truncRun1,runIndex1,signalIDs1] = Simulink.sdi.copyRun(runID1);
[truncRun2,runIndex2,signalIDs2] = Simulink.sdi.copyRun(runID2);

Delete Signals in Run Copy

The sldemo_fuelsys model is configured to log the values of the fault switches along with several signals representing the system's response. When you compare the system's response when a throttle angle sensor fails to its response when an exhaust gas oxygen sensor fails, comparing the fault switch states does not provide new information. Therefore, delete the switch signals before running the comparison to eliminate unnecessary computations.



Compare Truncated Runs

You can use the truncated runs you created with Simulink.sdi.copyRun and Simulink.sdi.deleteSignal to perform a comparison of the system's response to different types of failures. Then, open the Simulation Data Inspector to view the comparison results.

truncRunDiff = Simulink.sdi.compareRuns(truncRun1,truncRun2);


Input Arguments

collapse all

Signal to delete, specified as a scalar signal ID or vector of signal IDs. The Simulation Data Inspector assigns a unique numeric signal ID to each signal when a run is created for logged or imported data.

You can get the signal ID for a signal using one of these functions:

Version History

Introduced in R2016a