function r8vec_standardize_test ( )

%*****************************************************************************80
%
%% R8VEC_STANDARDIZE_TEST tests R8VEC_STANDARDIZE.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    03 October 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8VEC_STANDARDIZE_TEST\n' );
  fprintf ( 1, '  R8VEC_STANDARDIZE shifts and scales an R8VEC so that\n' );
  fprintf ( 1, '  it has zero mean and unit standard deviation.\n' );

  n = 10;
  a = -5.0;
  b = 15.0;
  seed = 123456789;

  [ x, seed ] = r8vec_uniform_ab ( n, a, b, seed );
 
  r8vec_print ( n, x, '  Vector X:' );
  mu = mean ( x );
  sigma = std ( x );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  mean(X) = %g\n', mu );
  fprintf ( 1, '  std(X)  = %g\n', sigma );
  fprintf ( 1, '  max(X)  = %g\n', max ( x ) );
  fprintf ( 1, '  min(X)  = %g\n', min ( x ) );

  xs = r8vec_standardize ( n, x );

  r8vec_print ( n, xs, '  Vector XS:' );
  mu = mean ( xs );
  sigma = std ( xs );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  mean(XS) = %g\n', mu );
  fprintf ( 1, '  std(XS)  = %g\n', sigma );
  fprintf ( 1, '  max(XS)  = %g\n', max ( xs ) );
  fprintf ( 1, '  min(XS)  = %g\n', min ( xs ) );

  return
end
