What is the command line way in MATLAB to find the hierarchy of a signal name used in a Simulink model with subsystems ?
6 views (last 30 days)
Show older comments
I have a Simulink model which consists of a top level model and subsystems. I use the same signal name in the toplevel model as well as within a subsystem. I would like to access the hierarchy of the signal name being used in my composite model, which will enable me to understand in which block the signal is existing.
Accepted Answer
MathWorks Support Team
on 2 Feb 2011
In the attached example model below, use the following commands on your MATLAB command line in order to see the various levels in which the signal 'x2' is used.
The command line way to access where the signal 'x2' is used in a model with subsystems:
p = find_system(gcs,'FindAll','on','Type','line', 'SegmentType', 'trunk','Name','x2');
get(p(:), 'Parent');
The ouput yields the subsystem level hierarchy of the signal first and continues up to the top level usage of the signal in the composite model.
Analysing the output after updating the model and executing the commands mentioned above, 'x2' is used in the following levels:
'vdp_example/Subsystem'
'vdp_example'
0 Comments
More Answers (0)
See Also
Categories
Find more on Subsystems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!