Hello all, I need some help on trying to plot these as a sine wave curve in Matlab, but can't seem to figure out how. Here's what I have:
t=0:5
r1=[(9.81/16)-(2.40/4)]*exp(-2*t)+(9.81/8)*sin(2*t);
r2=[(9.81/16)-(2.45/4)]*exp(-2*t)+(9.81/8)*sin(2*t);
r3=[(9.81/16)-(2.50/4)]*exp(-2*t)+(9.81/8)*sin(2*t);
figure(1) plot(t,r1) grid on
figure(2) plot(t,r2) grid on
figure(3) plot(t,r3) grid on
They are in the right plot and looks. But can't seem to get them into the sine wave curve I need them in. Any help would be great. Thanks.

 Respuesta aceptada

Star Strider
Star Strider el 23 de Jul. de 2017
Use the linspace function to define ‘t’:
t = linspace(0,5);

2 comentarios

Jim Xiong
Jim Xiong el 23 de Jul. de 2017
That was easy. Thanks.
Star Strider
Star Strider el 23 de Jul. de 2017
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 23 de Jul. de 2017

Comentada:

el 23 de Jul. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by