How to make the block value changeable while running the simulation

13 views (last 30 days)
Hello everyone,
I would like to ask how to make a block value changable while running the simulation. I found a simulation and they can adjust the value of the constant block (see the attached figure). By sliding the pointer on the bar, they could update the variable value. They also could set the limit values of the block as well.
Thanks for your help,

Accepted Answer

Rishi
Rishi on 16 Apr 2024 at 8:35
Hi Hoang,
I understand from your question that you want to know how to change the value of the constant block during the simulation as shown in the figure you've attached.
This can be achieved by using a Slider block. Add a Slider block to your model, and then connect this block to any tunable parameter. To connect a control block to a parameter in your model or to change the connection of a control block, enter connect mode. Select the block to whose parameter you want to connect. From the list that appears, select the parameter to which you want to connect.
You can learn more about Slider block from the documentation below:
Hope this helps!

More Answers (0)

Categories

Find more on Schedule Model Components in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!