Simulink: How to query selected signal / line programatically

This is how you can get the currently selected signal line in a Simulink model programmatically using MATLAB code.

This will give you a handle to the selected line(s) in the current system (gcs).

Here’s how to print their name, for example:

Example output:


Check out similar posts by category: Matlab/Simulink