format long; x = 0 : 1/64 : 1; h = 1/64; w = ones(1,65); w(2:2:64) = 4; w(3:2:63) = 2; f = exp(-x); sol = h*f*w'/3