Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
if i replace num with real num, like 17, it works, any one who knows why?

Akzeptierte Antwort

drummer am 24 Mär. 2023
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);
  1 Kommentar
wenchao zhang
wenchao zhang am 25 Mär. 2023
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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)


Mehr zu Simulink Functions finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by