Cos function in simulink

Is there any way I could get a cosine wave source in Simulink rather than just a sine wave?

답변 (1개)

Star Strider
Star Strider 2017년 12월 15일
편집: Star Strider 2017년 12월 15일

2 개 추천

Take the derivative of the sine?
Otherwise: Sine, Cosine (link).

댓글 수: 8

Oskar
Oskar 2017년 12월 19일
Thanks for the answer, how would i go about getting the derivative of sine? The goal is to get a cos wave generator like the sin source block.
Star Strider
Star Strider 2017년 12월 19일
My pleasure.
See: Sine, Cosine (link). You should be able to create a cosine signal directly.
Oskar
Oskar 2017년 12월 19일
Thanks, is there a way to edit the amplitude and frequency of the function? i need something like 10cos(181324/20000)
Star Strider
Star Strider 2017년 12월 19일
Yes.
After you add the block, right-click on it and select Block Parameters (Cos). You can edit them in the GUI that appears.
Steven Lord
Steven Lord 2017년 12월 19일
Another approach is to use a Trigonometric Function block with a couple Gain blocks to operate on the signal coming from a Clock source block.
Oskar
Oskar 2017년 12월 19일
When i double click the block i get block parameters cosine but I can only edit the number of points in the lookup table and output word length. When i go through right click > block parameters (subsystem) I get different properties but i can't change anything as it's all greyed out.
Star Strider
Star Strider 2017년 12월 19일
An even easier way to do it is to select the continuous-time Sin block from Sources, then use Block Parameters (Sin) set the Amplitude, Frequency, and then set Phase to pi/2. That defines a Cosine source!
I did this, and verified it with the Scope block that it was indeed producing a cosine curve.
I have not used Simulink in a few years, and it changed in the last few releases. It took me a while to explore it.
John D'Errico
John D'Errico 2024년 4월 9일
Exactly. Cosine can be viewed as just a phase shifted sine.

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

질문:

2017년 12월 15일

댓글:

2024년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by