Specify any block parameter values from other constant block (simulink)

I have multiple RLC blocks, and I want to control their parameter from one single block, so that I don't have to set for each RLC block.
What worked: Named a workspace variable as L1 with the desired value and as shown in RLC-block parameter it fetched the value easily.
What I'm trying: Remove the dependency of workspace variable. Hence, created one constant block. Named the block as L1 and called it in RLC-block. But, it is not working.
Is it possible? If yes, how?
update 1: using str2num(get_param('modelName/L1','Value')) works, but is there any other/efficient way to do it?

댓글 수: 5

Can you share your model?
As per my thinking, this is not model dependent. I'm attaching sample test model.
Have you checked my answer?
Yes, sorry to say that will not serve the purpose. Musking is very helpful for setting subsystem values from main block. What I require somewhat different. I have multiple blocks of same thing in different location. And I want to change their parameter in one single go. In case if it was coding, I would have used function to reduce repeatability. Thanks for assisting though.
I have multiple blocks of same thing in different location
Ok, then why don't you gather them within one subsystem? Will it be challenging? You can set inports and outports accordingly to that from subsystem and will not change the hierarchy of your model.

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

답변 (1개)

Birdman
Birdman 2018년 4월 2일

0 개 추천

The easiest overcome to this problem is using Masking in Simulink. Take all RLC blocks within the same subsystem and right click on your subsystem and go to Mask->Create Mask(or the shortcut with Ctrl+M), create a simple mask with the number of parameters you want to change in your model. I attach a model with simple mask. When you double click the subsystem, it immediately opens the parameter window where you can enter your parameter and simply hit Apply button. In the simulation, you will see immediate change.

댓글 수: 1

Hello, I am actually doing same thing for a different application. I have lots of constant block to run the simulation, I wanted to make them more useful so I masked but I cannot change the values of the constant with mask, everthing works fine but the valus does not change. I tried to do promote them but still its not working. Any suggestion for me ?
Regards,
Ege

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

카테고리

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

제품

태그

질문:

2018년 4월 2일

댓글:

2021년 6월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by