function predatorprey %parameters epsilon=0.1; %intervals of time which to run the model tspan=[0 100]; %the initial condition for susceptible and infected x0=[0.95; 0.05]; [t,x]=ode45(@f,tspan,x0); plot(t,x(:,1),t,x(:,2),'linewidth',2); xlabel('time'); ylabel('population'); legend('prey', 'predator'), pause plot(x(:,1),x(:,2),'linewidth',2); xlabel('prey'); ylabel('predator'); function dxdt=f(t,x) dxdt=[x(1)*(1-epsilon*x(1)-x(2)); x(2)*(x(1)-1)]; end end