
function demo

for n=100:100:500
    f=@(x) exp(x); a=0; b=2;
    I(n)=formula_rettangolo_composta(f,a,b,n);
    fprintf('\n \t n: %3.0f I(n): %1.15e',n,I(n));
end

fprintf('\n');


% >> demo
% 
%  	 n: 100 I(n): 6.325378505058198e+00
%  	 n: 200 I(n): 6.357164060481422e+00
%  	 n: 300 I(n): 6.367782908420759e+00
%  	 n: 400 I(n): 6.373096769211316e+00
%  	 n: 500 I(n): 6.376286505471986e+00
% 
% >> format long e
%  exp(2)-exp(0) % valore esatto 
%     ans =
%       6.389056098930650e+00
% >>
