% hw023.m
% John Burkardt
% Estimate area under y=humps(x) for 0 <= x <= 1.
%
n = input ( '  Enter number of intervals N: ' );
x = 0.0;
dx = ( 1.0 - 0.0 ) / n;
area = 0.0;

for i = 1 : n
  area = area + dx * humps ( x );
  x = x + dx;
end

fprintf ( '  Using N=%d intervals, area estimate is %g\n', n, area );

