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

1 回表示 (過去 30 日間)
Harsh Karve
Harsh Karve 2015 年 5 月 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 Center および File ExchangeProgrammatic Model Editing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by