Simulink: How to get a cosine wave with 'time dependent frequency'

10 ビュー (過去 30 日間)
Preetham Narayana Reddy
Preetham Narayana Reddy 2017 年 8 月 3 日
回答済み: Omur Bas 2017 年 8 月 30 日
I want to generate a cosine wave with the following equation.
x(t) = cos((wc + wx)t) where wx = w0 * cos(wm * t)
The values of wc,w0,wm are known and can be hardcoded. I am not able to put in the time dependency 't' in wx

回答 (2 件)

Meeshawn Marathe
Meeshawn Marathe 2017 年 8 月 9 日
Hi,
To implement this in Simulink, you can try using the "MATLAB Function" Block or the "Interpreted MATLAB Fcn" block. In addition, you would require an input block (In1), found in Simulink Sources.
Define a vector for time "t" (Ex: t=(0:0.01:10)') in the workspace. Go to Configuration Parameters -> Data Import/Export, select input and add [t,t] in the box. (One value of "t" is for simulation time and the other is for the input In1).
If you use a MATLAB function block, you can define the constants within it and write the cosine expression. If you use the other block, you would have to enter the constant values in the command prompt prior to running the model. Connect In1->Fcn block->Scope
Cheers!

Omur Bas
Omur Bas 2017 年 8 月 30 日
To find time explicitly in Simulink, you can use the "Clock" block.

カテゴリ

Help Center および File ExchangeSources についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by