when i want to modify the input number of certain component through script,error happens

1 次查看(过去 30 天)
if i replace num with real num, like 17, it works, any one who knows why?

采纳的回答

drummer
drummer 2023-3-24
Please take a look here.
I'm not familiar with this function, but as you declared num before, try to call it without ' '.
set_param('text/BC1', 'Inputs', num);
Cheers
  1 个评论
wenchao zhang
wenchao zhang 2023-3-25
thanks for your suggestion, i try it but still not working, but when i update the command as following, it works well. (i do it with matlab 2020b)
set_param('text/BC1', 'Inputs', num2str(num));
NOTE:set_param('text/BC1', 'Inputs', num) can works in matlbR2018b

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Simulink Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by