Setting parameters of a certain block

4 vues (au cours des 30 derniers jours)
Vinol Joy D'souza
Vinol Joy D'souza le 8 Août 2011
In my model ...i have a constant block feeding a summer ...i want the same value given in the constant block to be used as the switch on and switch off point value in a relay block...
How can i do it???

Réponse acceptée

Desiree
Desiree le 8 Août 2011
If you wanna change this offline you can use get_param and set_param commands to attain the value from the Constant block and set it for the Relay block. If you would like this to also update during simulation you would need to create a MATLAB S-Function for that. You can find an example for this here:
  1 commentaire
Vinol Joy D'souza
Vinol Joy D'souza le 8 Août 2011
Thank you very much :)

Connectez-vous pour commenter.

Plus de réponses (1)

Fangjun Jiang
Fangjun Jiang le 8 Août 2011
Is this what you want?
Define a variable in workspace, MyConstant=1, use this "MyConstant" for your Constant block and Relay block.
  1 commentaire
Vinol Joy D'souza
Vinol Joy D'souza le 8 Août 2011
even your solution is feasible
Thank you,,:)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by