How to generate a truncated sine wave using Simulink...?

Hello everyone!
I was wondering how I can use Simulink to generate a truncated sine wave..? I'm really confused and my professor didn't show an example on how to do this. I've tried using the sine wave block, but I couldn't really come up with a solution.
x(t) = {min{sin(t),0.5} if sin(t) >= 0
{max{sin(t),-0.5 if sin(t) < 0
The above equation is what I'm supposed to put in. I don't need the answer, just something to get me started.
Thanks in advance.

 採用された回答

Sebastian Castro
Sebastian Castro 2015 年 9 月 21 日

0 投票

Use a Sine Wave block and then connect a Saturation block after it (Simulink > Discontinuities), with limits of -0.5 and 0.5. That should do the trick!
- Sebastian

3 件のコメント

Ecem Kucuk
Ecem Kucuk 2015 年 9 月 21 日
thank you so much! i appreciate it
Keshav Chaudhary
Keshav Chaudhary 2018 年 10 月 29 日
How to do it in the Matlab code that is when we are not using the block?
Sebastian Castro
Sebastian Castro 2018 年 10 月 29 日
With the min and max functions.
>> data = min(data,0.5);
>> data = max(data,-0.5);
... or in one line:
>> data = max(min(data,0.5),-0.5);
- Sebastian

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by