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