How can I generate a sinusoidal wave in Matlab in one plot?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Duration 0-1, Step 0.02
Frequency 20 Hertz
Plot it across time duration (t)
0 commentaires
Réponse acceptée
Voss
le 27 Juil 2022
t_start = 0;
t_end = 1;
t_step = 0.002; % 0.002 looks more like a sinusoid than 0.02, but do what you like
f = 20;
t = linspace(t_start,t_end,round((t_end-t_start)/t_step)+1);
x = sin(2*pi*f*t);
plot(t,x);
0 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!