function y=humpsp(x)
%HUMPSP humps function with plotting and function evaluation counting
%
%  For demonstrating adapative quadrature routines.  The variable
%  nfun should be declared global and initialized to zero in the
%  calling environment.  It is incremented on each call to this
%  routine, so provides a count of total numbers of function evaluations
%  (if this routine is called with a vector argument, nfun is incremented
%  by the length of the vector).  Graphical output is achieved by starting
%  with a clean held graphics figures (use "clf; hold on; drawnow" in
%  the calling environment).  Each time this routine is called the
%  evaluation point is drawn, both on the curve and on the x-axis.
%
%  For a "animated" graphical display, include "drawnow; pause" or
%  "drawnow; pause(1)" at the end of this routine and set the axes (with
%  "axis([xmin xmax ymin ymax])" in the calling environment.

global nfun
y=humps(x);
nfun=nfun+length(x);
plot(x,y,'g*',x,zeros(size(x)),'y+')
%drawnow; pause
