Simulink Input Array with Trigger

4 vues (au cours des 30 derniers jours)
Emanuele Piatti
Emanuele Piatti le 10 Juil 2020
Commenté : Emanuele Piatti le 17 Juil 2020
Hi,
I have a question about inputs in Simulink.
I have a model which contains a control inside, and it does some iterations before getting the desired target value. I need to give the input to the system, then it iterates until it reaches the target; afterwards, I need to give the system the following input.
In practice, I want to provide the system with the next input of myinput array only after it has reached the target value for the previous input.
Which is the best way of handling this issue in Simulink?
I apologize if my question is trivial, but I am learning how to use Simulink and I am not an expert.
Thanks in advance,
Emanuele

Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 10 Juil 2020
A simplified example. Make two inputs, one is 5 and one is 10. Inside, Compare output to the first input (5) , if less, pass 5, else, pass 10 (the second input).
  7 commentaires
Fangjun Jiang
Fangjun Jiang le 14 Juil 2020
feed the output of your system (the desired target signal) to the input of the Lookup Table. When the value is anything <2 (2 is your target value), the output of the Table is 10 (which is your first input). When the value reaches 2, the output of the Table is 20 (which is your "the following input").
If your input is some kind of dynamic, you can make the Table output to be an index number such as 1, 2, 3 and then use this index number to control a Multiport Switch block.
Emanuele Piatti
Emanuele Piatti le 17 Juil 2020
Thank you very much, you have been very helpful.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by