function expode
    %EXPODE ODE for exponential growth, dx/dt = rx

    tspan = [0 10]; % this is the range of time to simulate for
    x0 = 1; % the initial value of x
    r = 1; % the value of the parameter r

    % solve the problem using ODE45, storing the solution in t and x
    [t,x] = ode45(@f,tspan,x0);

    figure(1), clf %open a figure window for plotting
    plot(t,x) %plot the solution
    % ---------------------------------------------------------------
    % function specifying the form of the ODE
    function dxdt = f(t,x)
        dxdt = r*x;
    end

end