how to create two sinusoidal signals

 Risposta accettata

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 Commenti

i dont get the graph.
Can you show me what you have tried?
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 il 7 Mar 2021
Modificato: xavier il 7 Mar 2021
got error on plot equation
Once I tried
@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 il 7 Mar 2021
Modificato: KALYAN ACHARJYA il 7 Mar 2021
@Jan yes, thanks @xavier Please note Jan's important comment, which I have missed that.
got the graph thank you so much
Kalyan hey
i have some work i need help
Open a new question, I'm busy with my work, so you can get answers from other members

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Centro assistenza e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by