Can you help me with ode45?
3 次查看(过去 30 天)
显示 更早的评论
Hello, I have some problem with my matlab code. I would like to use ode45, but the program gives me the error:
"Not enough input arguments.
Error in file>odefun (line 24)
dydt=5*y
Error in file (line 20)
[t,y] = ode45(odefun,tspan,y0)"
can you help me?
Thanksssss!!!
Ts = 1;
tspan=[0:Ts:10]; % time scale
y0=1; %initial condition
[t,y] = ode45(odefun,tspan,y0)
function dydt = odefun(t,y)
dydt = zeros (2,1)
dydt(1) = y(2);
dxdt(2) = -3*y(1);
end
0 个评论
采纳的回答
Walter Roberson
2019-5-19
[t,y] = ode45(@odefun,tspan,y0)
5 个评论
madhan ravi
2019-5-20
It means that you have custom file named ode45.m which thwarts the inbuilt function of MATLAB‘s ode45(). So move your file from MATLAB‘s path or rename it.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!