how to create two sinusoidal signals

 採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 7 日

1 投票

Hint:
A=.....%Amplitude
t=0:0.01:1; %time
ph=......%Set Phase difference
w=.....% Frequency
sin1=................% Asin(wt);
sin2=................%Asin(wt+ph);
plot(t,sin1,'-*r',t,sin2,'-ob');
grid on;

12 件のコメント

xavier
xavier 2021 年 3 月 7 日
i dont get the graph.
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 7 日
Can you show me what you have tried?
xavier
xavier 2021 年 3 月 7 日
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 7 日
A=10;%Amplitude
t=0:0.01:1; %time
ph=60;%Set Phase difference
w=20;% Frequency
sin1=A*sin(w*t);
sin2=A*sin(w*t+ph);
plot(t,sin1,'-*r',t,sin2,'-ob');
grid on;
xavier
xavier 2021 年 3 月 7 日
編集済み: xavier 2021 年 3 月 7 日
got error on plot equation
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 7 日
Once I tried
Jan
Jan 2021 年 3 月 7 日
@xavier: Please post code as text and a copy of the complete error message.
Remember, that the trigonometric functions like SIN() are using radians, no degrees. So either use:
ph = 60 * pi / 180;
or the sind() function.
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 7 日
編集済み: KALYAN ACHARJYA 2021 年 3 月 7 日
@Jan yes, thanks @xavier Please note Jan's important comment, which I have missed that.
xavier
xavier 2021 年 3 月 7 日
got the graph thank you so much
Evans Sigei
Evans Sigei 2021 年 3 月 12 日
Kalyan hey
Evans Sigei
Evans Sigei 2021 年 3 月 12 日
i have some work i need help
KALYAN ACHARJYA
KALYAN ACHARJYA 2021 年 3 月 12 日
Open a new question, I'm busy with my work, so you can get answers from other members

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by