I guess this is what you're looking for
e=0.1;
f=@(x)exp(x)./(1+x);
a=0.5;
b=1.1;
n=2;
h=(b-a)/n;
i=1:1:n-1;
S=f(a+i.*h);
tt = (h./2).*(f(a)+2.*sum(S)+f(b));
fprintf('The value of integration is %f\n', tt);
hx = 0:2:n;
x = a+h*hx;
plot(hx,f(x),'-o')
xlabel('h')
ylabel('f(x)')
Of course it is a straight line here because you x goes only to 2*h.
if you increase the number of interval you'd get something like this
e=0.1;
f=@(x)exp(x)./(1+x);
a=0.5;
b=1.1;
n=20;
h=(b-a)/n;
i=1:1:n-1;
S=f(a+i.*h);
tt = (h./2).*(f(a)+2.*sum(S)+f(b));
fprintf('The value of integration is %f\n', tt);
hx = 0:2:n;
x = a+h*hx;
plot(hx,f(x),'-o')
xlabel('h')
ylabel('f(x)')
You may notice that the value of the integral has also changed (it is more accurate now).