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

1 visualizzazione (ultimi 30 giorni)
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

Risposte (0)

Categorie

Scopri di più su Programmatic Model Editing in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by