Error in Using set_param
Mostrar comentarios más antiguos
I've not been able to set the consant in the "constant" block. I used: set_param('dummy/Constant','x',50) but kept getting eroor "Constant block does not have a parameter named 'x'". 'dummy' is the model name.
Thanks.
Respuesta aceptada
Más respuestas (1)
Brian B
el 14 de Jul. de 2014
Try
set_param('dummy/Constant','Value','50')
Note that the value is also a string.
4 comentarios
William
el 14 de Jul. de 2014
Brian B
el 14 de Jul. de 2014
Can you post the exact command that you tried? If I run
set_param('untitled/Constant','Value',50)
I get the error you describe. If I replace 50 with '50', I do not get an error.
William
el 15 de Jul. de 2014
Fuli Wang
el 13 de Dic. de 2019
x=50;
set_param('untitled/Constant','Value',num2str(x));
Categorías
Más información sobre Programmatic Model Editing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!