Don't get what is happening in matlab sin() function. need to know difference between sin(2*50*pi*t) and sin(2*1*pi*t)
Afficher commentaires plus anciens
Hi,
I am using Matlab to plot the sin graph. But when I put sin(2*50*pi*t) it shows something else than the sinusoidal curve. Can you please help me to find out why it is happening? Thanks in advance.
Code:
t = 0:0.1:20;
x = sin(2*50*pi*t);
y = sin(2*1*pi*t);
subplot(2,1,1)
plot(t,x)
subplot(2,1,2)
plot(t,y)

1 commentaire
Steven Lord
le 9 Sep 2022
It wouldn't help in this case but if you're computing the sine of pi times some angle, consider using the sinpi function instead of explicitly computing pi times the angle and calling sin.
Réponse acceptée
Plus de réponses (1)
William Rose
le 9 Sep 2022
1 vote
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
