MATLAB Answers

Who can help me with this please?

12 views (last 30 days)
mohammad massarwe
mohammad massarwe on 19 Apr 2021 at 15:30
Commented: Rik on 19 Apr 2021 at 15:38
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 Comment
Rik
Rik on 19 Apr 2021 at 15:38
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.

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!