function rms_test ( )

%*****************************************************************************80
%
%% rms_test() tests rms().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    09 March 2021
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'rms_test()\n' );
  fprintf ( 1, '  rms() evaluates the root-mean-square norm of a vector or matrix\n' );

  x = 1 : 10;
  v = rms ( x );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  X:\n' );
  disp ( x );
  fprintf ( 1, '  rms(x)\n' );
  disp ( v );

  A = [ ...
    5, 4, 3, 2, 1; ...
    4, 4, 3, 2, 1; ...
    0, 3, 3, 2, 1; ...
    0, 0, 2, 2, 1 ];
  v = rms ( A );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A:\n' );
  disp ( A );
  fprintf ( 1, '  rms(A):\n' );
  disp ( v )
%
%  RMS should be able to handle complex data as well.
%
  t = linspace ( 0, 2 * pi, 17 );
  t = t(1:16);
  z = cos ( t ) + i * sin ( t );
  v = rms ( z );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  z (complex):\n' );
  disp ( z );
  fprintf ( 1, '  rms(z):\n' );
  disp ( v )

  return
end
