generate a sine and cosine wave with 4 cycles .

4 ビュー (過去 30 日間)
MICHKEL ANGLO J
MICHKEL ANGLO J 2021 年 7 月 25 日
回答済み: Jan 2021 年 7 月 25 日
Pls give be a code to generate a sine and cosine wave with 4 cycles . No specified frequency just want four cycles.
  2 件のコメント
Jan
Jan 2021 年 7 月 25 日
This is not twitter: no # before the tags.
The questions sounds like a homework. Then the forum will not solve it fr you, because this would be a drawback for your success.
Please post, what you have tried so far and ask a specific question to your code. You will need 1 line of code only and the commands: plot, sin, cos. With a:b:c you create a vector from the value of a in steps of b until c.
MICHKEL ANGLO J
MICHKEL ANGLO J 2021 年 7 月 25 日
U mean x=0:1:3; y=sin(x); stem(x,y);is it crt. I want discrete so I am using this stem fn. @jan

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

採用された回答

Jan
Jan 2021 年 7 月 25 日
0:1:3 is [0,1,2,3]. This is less than 4 cycles. 4 cycles mean:
x = 0:0.1:8*pi
stem() is working. plot(x,y, '.') is an option also.

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by