How to run a periodic custom signal in simulink

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!

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 28일

0 개 추천

You can use a repeated sequences block

댓글 수: 3

Vera
Vera 2013년 2월 28일
Hi, Thank you for the answer. I already tried to use the repeating sequence and it could be a good solution. The only problem I have is that the period of my signal is changing depending on other parameters and, sice the repeating sequence block does nbot accept inputs, I don't know how to modify that value.
Maybe you can help me solve this problem.
Post your model and your embedded function
Vera
Vera 2013년 3월 14일
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.

댓글을 달려면 로그인하십시오.

Kaustubha Govind
Kaustubha Govind 2013년 2월 28일

0 개 추천

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

Vera
Vera 2013년 2월 28일
Hi, Thank you for your answer. In the while I used the clock block, but it does not seem to be a good choice.
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.

댓글을 달려면 로그인하십시오.

카테고리

제품

질문:

2013년 2월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by