How can I limit in time a sine wave in Simulink

조회 수: 6 (최근 30일)
Mike Adwa
Mike Adwa 2016년 2월 7일
편집: Gojo 2024년 8월 31일
Hello everyone !
I have to face a problem and I cannot find a solution. Could you help me ? Actually, in simulink, I would like to use a sine wave but just during a precise time. Let's say I want to do a simulation during 100s and I would like to use the sine wave just during 10s and then stop. How can I do that ? How can I control in time my sine wave ?
Thank you very much for your help !
- Mike
  댓글 수: 1
selenaz
selenaz 2024년 8월 30일
hii,am facing the same problem..how did you solve it?
thanks in advance

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

답변 (1개)

Gojo
Gojo 2024년 8월 31일
편집: Gojo 2024년 8월 31일
Hey Mike,
I understand that you want to use sine waves only for some specified time steps. I believe you could achieve this functionality by using a Switch Block. You can pass a control signal which would have a True value when you would want to use the sine wave and else it would have a False value. You can generate this signal as an array in your MATLAB workspace if you know ahead in time at which time steps you would require to use the sine wave. Otherwise you could generate this control signal by using a Clock Block and your logic in Simulink itself.
Once you have the above mentioned control signal, you can use the Switch Block to output the Sine wave when the control signal has a True value, otherwise you may output a constant signal from the block. You can create your own subsystem as below:
I hope this helps!

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by