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.

 채택된 답변

Star Strider
Star Strider 2017년 7월 23일

0 개 추천

Use the linspace function to define ‘t’:
t = linspace(0,5);

댓글 수: 2

Jim Xiong
Jim Xiong 2017년 7월 23일
That was easy. Thanks.
Star Strider
Star Strider 2017년 7월 23일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2017년 7월 23일

댓글:

2017년 7월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by