function xprime = rabfox(t,x) % rabfox: System of 2 ODE for the rabbits and foxes % predator-prey problem. % t is the time % x(1) is the rabbit population at time t % x(2) is the fox population at time t % The system is % x(1)' = 2x(1) - 2x(1)x(2) % x(2)' = -x(2) + x(1)x(2) % % the right hand sides are returned as a column vector % since ode45 requires a column vector xprime = [2*x(1) - 2*x(1)*x(2); -x(2) + x(1)*x(2)]; end