n = 20;
max = 10;
h = max/n;
x = linspace(0,max,n);
ye = zeros(size(x));
yc = zeros(size(x));
yp = exp(-x);
ye(1) = 1;
yc(1) = 1;

for i=1:n-1,
   ye(i+1) = ye(i)*(1-h); 
end
%plot(x,yp,x,ye)

yc(2) = yc(1)*(1-h/2);
for i = 2:n-1,
   yc(i+1) = yc(i-1)-2*h*yc(i); 
end
plot(x,yp,x,ye,x,yc)