Get current signal selecton in Simulink Data Inspector

4 views (last 30 days)
I am using Simulink Data Inspector for visualization of project log data. One of my goals is to allow the user to save their active signal selection to be retrieved at a later point or to be re-used for another log. I am struggling a bit with the options on the CLI that are available for Simulink Data Inspector: I don't see a possibility to retrieve the plot handle where a certain signal is plotted.
One of my tries involved iterating all the signals of a run:
run_IDs = Simulink.sdi.getAllRunIDs
run_IDs =
2×1 int32 column vector
52435
54813
run1 = Simulink.sdi.getRun(run_IDs(1));
sig_IDs = run1.getAllSignalIDs;
sig = run1.getSignal(sig_IDs(1))
sig =
Signal with properties:
ID: 52446
RunID: 52435
Name: 'MessageChecksum_CRC8H2F_2B'
Domain: 'Signals'
Description: ""
DisplayUnits: ''
StoredUnits: ''
DataType: 'double'
Complexity: "real"
ComplexFormat: "real-imaginary"
SampleTime: 'Continuous'
Model: ''
BlockPath: ''
FullBlockPath: ''
BlockName: ''
PortIndex: 0
Dimensions: 1
Channel: [1×0 int32]
NumPoints: 4040
Checked: 0
LineColor: [0.9290 0.6940 0.1250]
LineDashed: '-'
LineWidth: 1
InterpMethod: 'linear'
AbsTol: 0
RelTol: 0
TimeTol: 0
OverrideGlobalTol: 0
SyncMethod: 'union'
Values: [1×1 timeseries]
RootSource: 'ds_ddsdata.getElement(1)'
TimeSource: 'ds_ddsdata.getElement(1).Time'
DataSource: 'ds_ddsdata.getElement(1).Data'
Children: [0×0 Simulink.sdi.Signal]
The properties one gets for a signal type include if it's currently visible (=Checked) or not. However, there is no way to get the current plot where it is active, i.e. if it's the signal in the plot to the bottom right.

Answers (1)

David Kröter
David Kröter on 15 Jun 2022
Another option that I could think of is to retrieve the axis handles of the individual plots in the Signal Inspector, but I didn't find a way yet how to achieve that...

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!