How to solve this odearguments error when trying to use 'ODE45' command?
4 次查看(过去 30 天)
显示 更早的评论
I got an error:
Error in ode45 (line 115)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in solution (line 9)
[t,x] = ode45('func',[0 5],[0 0]);
My code is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/557022/image.png)
0 个评论
回答(1 个)
Cris LaPierre
2021-3-21
Your syntax is wrong. You are passing in a character array to ode45, not a function.
Use @func instead of 'func'.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!