How can I update a constant block value based on the output results in simulink

3 views (last 30 days)
Hi,
How can I update a constant block value in simulink? This value is an input for the whole model, and the model runing with a matlab function block, where I have to adjust the constant block value based on the output from this matlab fuction.
In the matlab function block it does not support 'set_param' command, is there any way to update the input constant value? The constant block itself is not in the matlab function block but the value will run into the function model.
Thanks!

Answers (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 23 Jun 2019
Hi,
In your case, if understood your problem correctly, one of the possible ways is to name the constant block value with a new variable name and the iterative value of the variable need to be defined respectively within your matlab function.
Good luck.

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Products


Release

R2018a

Community Treasure Hunt

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

Start Hunting!