function dy=NPZeqns(t,y) % This function will be called from the command line using syntax such as: % >> [T,Y]=ode45(NPZeqns,timevec, [80 10 10 ]); % This will return a matrix of Y values of size (length(timevec),3), where Y(:,1) is N, Y(:,2) is P, and Y(:,3) is Z. % timevec can be defined such as: % >> timevec=0:1:150; % which will give you one timestep per day for 150 days. k1=1.5; k2=20; k3=.01; k4=0.3; k5=.2; dy=zeros(3,1); dy(1)=(k5*y(3)+k3*k4*y(2)*y(3))-k1*y(1)/(y(1)+k2)*y(2); dy(2)=k1*LF*y(1)/(y(1)+k2)*y(2)-k3*y(2)*y(3); dy(3)=k3*(1-k4)*y(2)*y(3)-k5*y(3);