MATLAB: Can you help me with ode45

argomentserrorfunctioninputodeode45system

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

Best Answer

[t,y] = ode45(@odefun,tspan,y0)
Related Question