Not enough input arguments ode45
Mostra commenti meno recenti
Hi everyone,
I have a problem with an ode45 function. Hier is my code:
function dx=num_lsg1(t,x)
dx=zeros(2,1);
dx(1)=k*x(2)-x(1)*(1-x(2));
dx(2) = (x(1)*(1-x(2))-kmm*x(2))/e;
%def parameters
k=0.625;
e=0.001;
kmm=1;
s0=1;
c0=0;
t=linspace(0,0.01,100);
x0=[s0 c0];
% Main program
[t,x]=ode45(@(t,x) num_lsg1(t,x), t, x0);
plot(x(:,1),'-o', x(:,2),'-x');
end
Hier is the arror message:
>> num_lsg1
Not enough input arguments.
Error in num_lsg1 (line 5)
dx(1)=k*x(2)-x(1)*(1-x(2));
Could someone help me to find the problem?
Thank you!
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Ordinary Differential Equations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

