How can I send a value from GUI to constant block in Simulink Model?
1 次查看(过去 30 天)
显示 更早的评论
I have threee constant block. And I want to value to those from GUI when ı pushed the button after ı take value from edit text blocks.
0 个评论
采纳的回答
Birdman
2017-12-12
As far as I know, edit text blocks takes input arguments as string. What you need to do is to use set_param command and convert the variables to double by using str2double command.
We have had a previous discussion about it, so please refer to that discussion. Here is an example:
set_param('gui/Constant','Value','i')
set_param('gui/Constant1','Value','j')
Do not forget to convert these values to double.
12 个评论
KL
2017-12-12
this is not recommended...
@Birdman: yet you recommend it.
@bayram özmen: Please be warned about the risks associated with using assignin.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Block Libraries 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!