%% Studying an unstable ODE

dsolve('Dy = y - 3*exp(-2*x)', 'y(0)= 1', 'x')

f = inline('y - 3*exp(-2*x) ','x','y');
[x,ya1]=ode45(f,[0,15],1);
plot(x,ya1)
hold on
ezplot('exp(-2*x) ',[0 15])
hold off
axis([0 15 -1 2])
xlabel 'x'
ylabel 'y'
title 'Fig. A1. Exact and Approximate Solutions'

print -dpng figureA1
