open several Simulink models and interakt with the opend model

Hi, i can select with radiobuttons several Simulink models.
function Bone_SelectionChangeFcn(hObject,eventdata, handles)
if hObject == handles.Skull
load_system('Skull')
open_system('Skull')
else if hObject == handles.Femur
load_system('Femur')
open_system('Femur')
end
end
after this i wanna replace with slider values of constant in the opend model. But i dont know how can i interact only with the opend model. Cau u guys help me pls?
THX

 채택된 답변

Andreas Goser
Andreas Goser 2013년 7월 29일
편집: Andreas Goser 2013년 7월 29일
I suppose you will be close to your solution once having a look at the commands
bdroot
gcs
gcb

추가 답변 (1개)

sia
sia 2013년 7월 29일

0 개 추천

Hi, thanks for the answer. But i solved it.
Now i wanna connect 2 simulink models to each other. such that, they will exchange value with each other.
Do you know any way to do this. But i dont want it as subSystem.
THX

댓글 수: 5

You could control this through MATLAB using SIM commands, but in fact it seems to be smarter to me to merge your models into one instead of connecting them. Please have a look at the concept of subsystems, especially "model referencing".
Hi, yes you are right, it is smarter to make it with subsystem. But now i have another problem. I know i can load a system (model) with the command load_system(modelname). But i dont want to laod the whole model but only one subsystem into this model. Do youknow any command for that???
Andreas Goser
Andreas Goser 2013년 7월 30일
편집: Andreas Goser 2013년 7월 30일
I was thinking of interactive copy/paste of the respective subsystem, but in cases there is a need to do it programmatically, you can use ADD_BLOCK
did i understand it right? can i e.g. create 2 models and load_system('') these then add one of the into the other as a subSystem??? It is possible???
This is indeed possible, but without background information of your application, I can't say whether it makes sense or not. I can just say that most user don't do this at all, but develop one larger model. In case you want to modify parts of this larger model easy, please have a look at variants.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

질문:

sia
2013년 7월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by