Plotting trajectory of variation of two population with the time
Mostrar comentarios más antiguos
I have this differential equation that describes the variation of two populations:
function [dxdt]= raueber(t,x,m)
dbdt=x(1)^1*(1-x(1))-x(2)*x(1);
drdt=x(1)*x(2)-m*x(2);
dxdt=[dbdt; drdt];
I already solved the ODE with:
[time,x_result]=ode15s(@raueber,tspan,X0,'',m1);
dxdt = raueber(time,x_result,m1);
and before I gave all the parameters and values.
Now I'd like to plot the trajectory, wich means B on the x-axes and R on the y-axes. I tried:
plot(x_result(1), x_result(2))
but it's not worthy.. any suggestion?
Respuestas (1)
Azzi Abdelmalek
el 23 de Jun. de 2015
Editada: Azzi Abdelmalek
el 23 de Jun. de 2015
plot(x_result(:,1),x_result(:,2))
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!