How can I find the top level of the entire system from within an active model reference?
Ältere Kommentare anzeigen
My MEX functions look upwards in the subsystem heirarchy to get some information from top-level configuration blocks, which specify system wide parameters for my system. Normally I would find these with find_system(bdroot(gcb), ...).
But supposing I want to use model referencing. Is there any way a block in a referenced model can, during initialization of a system referencing it, find the top level of the referencing system? bdroot(gcb) will only get me to the top of the referenced model - not the active referencing model.
Akzeptierte Antwort
Weitere Antworten (4)
Titus Edelhofer
am 13 Mai 2011
0 Stimmen
Hi,
I guess, not directly. And it should not be done anyway: the idea of model referencing is, that the referenced model is self-sufficient, i.e., it can stand alone without the system referencing it. The other way round of course is fine: the model containing the referenced model might very well do something with this model ...
Titus
Mark
am 13 Mai 2011
0 Stimmen
Mark
am 13 Mai 2011
0 Stimmen
Todd
am 29 Sep. 2020
0 Stimmen
If your reference model is open in a tab of your top model (R2020a+) then you can try this:
h = gcbp;
sys = bdroot(h.getBlock(1));
Kategorien
Mehr zu Subsystems finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!