why doesn't this ODE45 function work?
显示 更早的评论
This is from the actual tutorial: https://www.youtube.com/watch?v=9nnaFaDlmuc&feature=youtu.be
but when I plug the following commands in :
tSpan=[0;10]; x0=[4999;1;0]; [tSol,xSol] =ode45(@SIRmodel,tSpan, x0) function dxdt=SIRmodel(t,x) dxdt=[-2*x(1)*x(2)/5000; 2*x(1)*x(2)/5000-2*x(2)/3;2*x(2)/3]; end
I get this error message: Undefined function or variable 'SIRmodel'.
Error in odearguments (line 90) f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 115) odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
>> Was there a mistake in the video?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!