% script rabfox_test.m % range of time values tspan = [0,20]; % row or column vector can be used to specify the % initial conditions init = [1,3]; % solution is returned as a column vector t and % an n by 2 matrix x. The first column x(:,1) is % the rabbit population and the second column % x(:,2) is the fox population options = odeset('RelTol', 1e-6, 'AbsTol', 1e-6); [t,x] = ode45(@rabfox, tspan, init, options); figure(1); plot(t,x(:,1),'-', t,x(:,2),'--') xlabel('time') legend('rabbits', 'foxes') figure(2); plot(x(:,1),x(:,2),'-') xlabel('rabbits') ylabel('foxes')