Can I update system parameter in Simulink model as well as on Target through script?

1 次查看(过去 30 天)
I shall use an example to explain my problem: In script, I define a parameter 'a', as follows
a=2;
I have a model with a constant block, labelled 'Constant'. In the 'Value' parameter, I type 'a'. I then build the model to the target. Now when I enter the following command:
tg=xpc;
getparamid(tg,'Constant','Value');
Matlab can't find the parameter. When I look in the target explorer, I see the parameter listed as 'a', under block name, 'Model Parameters'. So I enter the following:
getparamid(tg,'Model Parameters','a');
aaand nothing. I would like to update a parameter in a Simulink model and the downloaded model using a script. Is there a way to do both using one workspace variable?
Thanks in advance for any responses,
Harsh

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by