Systems Biology - Maltus Law
2 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
Star Strider
on 7 Aug 2018
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)
0 Comments
See Also
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!