function [t,x]=firstorderRK45
 
   % [t,x] = ode45(@f,[t0,tf],x0)
   % ode45 = runga-kutta 45. One of matlab's many solvers.
   % INPUT
   %  dxdt = f is the differential equation to solve.
   %  [t0, tf] = the interval of time to solve the ode.
   %  x0 = the initial value of x.
   % OUTPUT:
   %  t = array of time values for which solution was computed.
   %  x = array of u values, the solution.
    [t,x] = ode45(@f,[0 10],2);     
    
    plot(t,x);
    xlabel('t')
    ylabel('u')
    axis([0 10 0 3]); % Set plot axis to [tmin tmax xmin xmax]. 
 	
end

function dxdt = f(t,x)

   dxdt = zeros(1,1); % Create a column vector.

   % LOGISTIC EQUATION
   % Set values for the parameters.
    r = 1;
    K = 1.0; 
    p = 1.0;
   % Define the equation.
    dxdt(1) = r*x(1)*(K-x(1));
   % dxdt(1) = r*x(1)*(K-x(1)^p);
   % dxdt(1) = r*x(1)*(K-x(1))-H;
  
end
