How can I reference a Simulink signal line easily?

2 views (last 30 days)
When you want to reference a block in a model you can use the full path to the block. For example, if you wanted to embed a link to highlight a block in f14, you can do this:
disp(['<a href="matlab:hilite_system(''f14/Stick Input'')">test1</a>']);
But the same is not true for lines. The best you can do now is this:
ports = get_param(get_param('f14/Gain','Handle'),'PortHandles');
lh=ports.Outputs(1);
disp(['<a href="matlab:hilite_system(' sprintf('%1.15f',lh) ')">test</a>']);
The problem is that this does not persist if the model is closed and reopened.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
There is no direct way of referencing to a Simulink signal in a model.
As a workaround , you can use the helper function (getOutputSignal) attached to this solution that would allow you to specify block and port (input/output, and port number), and then outputs a solid path to the line.
For instance, you can create a hyperlink to a Simulink signal line in the F14 model to the output of the Gain block using the following command:
open_system('f14');
disp(['<a href="matlab:hilite_system(getOutputSignal(''f14/Gain'',1))">test</a>']);

More Answers (0)

Categories

Find more on Simulation in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!