clear all,clc
maxnorm=[];
for tt=1:3,
    ttt=cputime;
    h=10^-tt;
A=zeros(1/h+3);B=zeros(1/h+3,1);
A(1,1:3)=[1/6 2/3 1/6];A(end,end-2:end)=[1/6 2/3 1/6];
for i=1:1/h+1,
    A(1+i,i:i+2)=[2+h -4 2-h];
    B(1+i)=-exp((i-1)*h-1)-1;
end
B=2*h*h*B;
C=A\B;C=C.';
x=0:h:1;
R=zeros(size(x));
R(1:end-1)=1/6*C(1:end-3);

R(1:end-1)=R(1:end-1)+C(2:end-2)*2/3;
R(2:end)=R(2:end)+C(2:end-2)*1/6;

R(1:end-1)=R(1:end-1)+C(3:end-1)*1/6;
R(2:end)=R(2:end)+C(3:end-1)*2/3;

R(2:end)=R(2:end)+C(4:end)*1/6;
R=R/2;
ue=x.*(1-exp(x-1));
maxnorm=[maxnorm max(abs(ue-R))];
cputime-ttt
end
maxnorm