hilite_system inside a library block
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to use hilite_system to hilite a simulink block, however that block lies inside a library block. If I open the model and make the call to hilite_system I get an error that the object name is invalid. However if I navigate throught the model into the library block and try again it works. It would appear that the problem is that the library block is not fully "loaded"? Is there a way around this?
0 Kommentare
Akzeptierte Antwort
Fangjun Jiang
am 18 Mär. 2011
It is true. When you open the model, Simulink doesn't automatically load all the customized library blocks.
To make your script work, I suggest adding a line after you open the model.
Open_system(Model); find_system(Model,'FollowLinks','On');
5 Kommentare
Weitere Antworten (1)
Fangjun Jiang
am 22 Mär. 2011
So you have a model with nested library links. I have a model with three layers of nested library links. The find_system() seems to work so I don't know why it didn't work in your case. I am using R2007b.
Try a different approach, run the command libinfo(Model) after opening the model. It works too in my case. If it works for you, it might be easier than parsing the block path.
Siehe auch
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!