function hypercube_distance_test ( )

%*****************************************************************************80
%
%% hypercube_distance_test() tests hypercube_distance().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    10 January 2021
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../hypercube_distance' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'hypercube_distance_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s.\n', version ( ) );
  fprintf ( 1, '  Test hypercube_distance()\n' );

  fprintf ( 1, '\n' );
  fprintf ( 1, '   M      N      Mu        Var\n' );
  fprintf ( 1, '\n' );
  n = 10000;
  for m = 2 : 10
    [ mu, var ] = hypercube_distance_stats ( m, n );
    fprintf ( 1, '  %2d  %4d  %8.4f  %8.4f\n', m, n, mu, var );
  end

  fprintf ( 1, '\n' );
  n = 10000;
  for m = 2 : 10
    hypercube_distance_histogram ( m, n );
    filename = sprintf ( 'hypercube_distance_histogram_%d.png', m );
    print ( '-dpng', filename );
    fprintf ( 1, '  Graphics saved in "%s"\n', filename );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'hypercube_distance_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  fprintf ( 1, '\n' );
  timestamp ( );

  rmpath ( '../hypercube_distance' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

