Systems Biology - Maltus Law

1 次查看(过去 30 天)
JB
JB 2018-8-7
Greetings!
I recently tried to run my code using ode45:
Define function in ODE called "sysbio1.m":
function dzdt = sysbio1(t,z,k)
dzdt=k*z;
end
Parameters in command window:
k = 0.7;
x0 = 1;
tspan = [0,5];
[t,x] = ode45(@sysbio1,tspan,x0,[],k);
plot(t,'XData',k)
I am trying to make a plot that simulates numerical integration. I think I am on to something, but I am sure it is trivial to some of you. Any assistance would be greatly appreciated.
V/R jb

回答(1 个)

Star Strider
Star Strider 2018-8-7
Use this ode45 call instead:
[t,x] = ode45(@(t,z)sysbio1(t,z,k),tspan,x0);
and change the plot call to:
plot(t,x)

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by