I am trying to type:
[(d^2)y/d(t^2)] + 3.6(dy/dt) + 3.24y = -10(e^(-1.8t))
but it is saying parse error at 't' on line 5
function dydt = order2(~,y)
dydt = zeros(size(y));
a = 3.6; %coefficient for y; term
b = 3.24; %coefficient for y term
r = -10*e-1.8t; %forcing function
dydt(1) = y(2);
dydt(2) = r -a*y(2) - b*y(1);

댓글 수: 1

KSSV
KSSV 2021년 12월 4일
Show us full code which you have tried.

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

 채택된 답변

Dave B
Dave B 2021년 12월 4일

1 개 추천

When you multiply in MATLAB you need a * symbol
r = -10*e-1.8t;
should be
r = -10*e-1.8*t;

댓글 수: 1

Steven Lord
Steven Lord 2021년 12월 4일
You will also need to define a variable named t in your function by replacing the ~ in the function signature on the first line with t.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

릴리스

R2021b

태그

질문:

N/A
2021년 12월 4일

편집:

2022년 3월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by