How to run a periodic custom signal in simulink

5 visualizzazioni (ultimi 30 giorni)
Vera
Vera il 28 Feb 2013
I created a custom signal to run in a simulink model using an embedded MATLAB Function. Now I would like to repeat this signal periodically for a certain amount of time. How can I implement the periodic repetition in Simulink? I thought to use a while-loop but it does not work.
Thank you for any idea!

Risposte (2)

Azzi Abdelmalek
Azzi Abdelmalek il 28 Feb 2013
You can use a repeated sequences block
  3 Commenti
Azzi Abdelmalek
Azzi Abdelmalek il 28 Feb 2013
Post your model and your embedded function
Vera
Vera il 14 Mar 2013
Hi, I worked more on the idea of a "repeated sequence -like" signal and I think solved the problem. I did something similar to a repeated sequence, which made my function periodical. As input time I created a block with the function rem(u[1],u[2]), with u[1]=clock and u[2]=period. In this way I can change the input "period" as I wish during the run. Thank you anyway for your suggestion, it helped me to think more in that direction.

Accedi per commentare.


Kaustubha Govind
Kaustubha Govind il 28 Feb 2013
You'll need to write your MATLAB Function so that it repeats the same operation periodically. How do you maintain the "state" of the block? Do you use a persistent variable, or use the Clock block?
  2 Commenti
Vera
Vera il 28 Feb 2013
Hi, Thank you for your answer. In the while I used the clock block, but it does not seem to be a good choice.
Kaustubha Govind
Kaustubha Govind il 14 Mar 2013
Vera: I didn't mean for you to use the Clock block inside the While iterator. I was only asking how to maintain the state of the block.

Accedi per commentare.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by