setting simulink block values from command line
2 次查看(过去 30 天)
显示 更早的评论
Hi,
Does anyone know whether it is possible to pass a variable name to a simulink block when defining it from the command line? So in the following code:
src='built-in/Constant'; dest=strcat(systemname,'/','example'); add_block(src, dest, 'Value', '5', 'position',position)
instead of '5', i would like to pass a variable name e.g. 'a' which can later be defined in an m-script.
regards, Thijs
0 个评论
采纳的回答
Paulo Silva
2011-2-23
set_param('systemname/blockname','Value','a')
1 个评论
Anmol Kodgire
2018-9-20
i have value stored in a variable.(e,g a=5) how can i get the value stored in variable (i.e 5). if i use your logic, the block will have value 'a'
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!