Hauptinhalt

Simulink.sdi.copyRunViewSettings

R2026b

Copy line style and color for signals from one run to another

Description

sigIDs = Simulink.sdi.copyRunViewSettings(run1,run2,plot) copies the line style and color specifications from run1 to run2 for matched signals. If plot is true, Simulink.sdi.copyRunViewSettings also replaces any plot of an aligned signal from run1 with the matching signal in run2. The function returns an array of signal identifiers for the signals that the Simulation Data Inspector aligned between the two runs. To learn more about how the Simulation Data Inspector aligns signals between runs, see How the Simulation Data Inspector Compares Data.

example

Examples

collapse all

Suppose that you have three runs from the same model in the Simulation Data Inspector. If you change the line color or style of signals in the first run and would like to reuse those setting in the third run, you can copy the view settings.

Get the run IDs for the first and third runs.

allRunIds = Simulink.sdi.getAllRunIDs;
run1 = allRunIds(1);
run3 = allRunIds(3);

Copy the view settings from the first run to the third run.

alignedSigs = Simulink.sdi.copyRunViewSettings(run1,run3,false)

Input Arguments

collapse all

Source run in the Simulation Data Inspector with the view settings you want to copy, specified by a run ID or Simulink.sdi.Run object. The Simulation Data Inspector assigns run IDs when it creates runs. You can get the run ID for your run using Simulink.sdi.getAllRunIDs or Simulink.sdi.getRunIDByIndex.

Destination run in the Simulation Data Inspector that you want to copy the view settings to, specified by a run ID or Simulink.sdi.Run object. The Simulation Data Inspector assigns run IDs when it creates runs. You can get the run ID for your run using Simulink.sdi.getAllRunIDs or Simulink.sdi.getRunIDByIndex.

Whether to replace plotted signals from run1 with signals from run2 in Simulation Data Inspector when the signals are aligned, specified as true or false.

  • When plot is true, for all aligned signals, the Simulation Data Inspector updates plots to use data from run2.

  • When plot is false, the Simulation Data Inspector does not change which signals are plotted.

Output Arguments

collapse all

Signal IDs for aligned signals, returned as a column vector containing the signal IDs for signals in run2 that aligned with signals in run1 and had view settings modified.

Version History

Introduced in R2016a