Who can help me with this please?

1 次查看(过去 30 天)
mohammad massarwe
mohammad massarwe 2021-4-19
评论: Rik 2021-4-19
function [dy] = quest1(t,y)
dy1= zeros(2,1)
dy(1) = y(2);
dy(2) = -2*y(2)-2*y(1)+(1*sin(2*t));
[t,Y] = ode23(@quest1,[0 10],[2 -3]);
figure(1)
plot(t,Y(:,1));
  1 个评论
Rik
Rik 2021-4-19
Since you didn't give any plausible inputs:
dy1= zeros(2,1);
dy(1) = y(2);
Unrecognized function or variable 'y'.
dy(2) = -2*y(2)-2*y(1)+(1*sin(2*t));
[t,Y] = ode23(@quest1,[0 10],[2 -3]);
figure(1)
plot(t,Y(:,1));
The next error would be the missing quest1 function, followed by the error you're getting.
You can find guidelines for posting homework on this forum here. If you have trouble with Matlab basics you may consider doing the Onramp tutorial (which is provided for free by Mathworks). If your main issue is with understanding the underlying concept, you may consider re-reading the material you teacher provided and ask them for further clarification.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by