format long a=0; b=1; n=64; h=(b-a)/64; x=a:h:b; f=ones(1,65); for i=1:65 f(i)=exp(-x(i)); end f=f'; w=ones(1,n+1); w(2:2:n)=4; w(3:2:n-1)=2; s=w*f*h/3