Referencing 1) Simulink Model Components In Subsystems and 2) Workspace variables
Info
This question is closed. Reopen it to edit or answer.
Show older comments
I need to access / change simulink model component parameters (such as gain values) when using subsystems. I can access the root level of the simulink model with "set_param([bdroot '/GainBlock1'],'Gain',str)" but how would i do the same in a subsystem. The other question I have is very similar. I would also like to change workspace variables using similar method, but again I cant get it to work. Your help really appreciated Kind regards, Ian
Answers (1)
Sebastian Castro
on 29 Jul 2015
For your first question, you should be able to the following without any issues:
>> set_param([bdroot '/Subsys/Subsubsys/BlockName'])
For your second question, what type of workspace variables are you concerned about? I'm guessing it's not the MATLAB base workspace, because those you can change directly in the Command Window:
>> x = 2;
Are you perhaps also working with model references and model workspaces?
- Sebastian
1 Comment
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!