%% QUAD_POOL uses the PARPOOL command to run the QUAD code.
%
%  Discussion:
%
%    Output printed by the function appears directly on the screen.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    19 September 2014
%
%  Author:
%
%    E.M. Cliff
%
  mypool = parpool('local', 4) %#ok  display the mypool object

  n = 10000; a = 0.0; b = 1.0;
  fprintf ( 1, '\n' );
  fprintf ( 1, 'QUAD_POOL\n' );
  fprintf ( 1, '  Estimate integral using %d points\n', n );

  value = quad_fun ( n, a, b );

  delete(mypool)

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Integral estimate is %f\n', value );
  fprintf ( 1, '  Exact integral    is %f\n', pi );
  fprintf ( 1, '  Error is             %e\n', abs ( value - pi ) );
