Sine wave signal stop time
Mostrar comentarios más antiguos
Hi all,
I am generating a sine wave as shown below:
Fs = 8000;
dt = 1/Fs;
t = 0: dt: 3;
Fc = 320; % hertz
x1 = sin(2*pi*Fc*t);
plot(t,x1);
How can I make the sine wave stop after 2 seconds please?
2 comentarios
Geoff Hayes
el 3 de Mayo de 2015
John - please clarify what you mean by wanting to make the sine wave stop after 2 seconds. Do you only want to show 2 seconds of data, and if so, then just initialize t as
t = 0:dt:2-dt;
John Smith
el 3 de Mayo de 2015
Respuesta aceptada
Más respuestas (1)
KL
el 3 de Mayo de 2015
Fs = 8000;
dt = 1/Fs;
t1 = 0: dt: 2;
t2 = 0*(2: dt : 3);
t = [t1 t2];
Fc = 320; % hertz
x1 = sin(2*pi*Fc*t);
plot(t,x1);
is this what you want?
Categorías
Más información sobre Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!