function value = rms_norm ( X )

%*****************************************************************************80
%
%% rms_norm() returns the RMS norm of a vector or 2D array.
%
%  Discussion:
%
%    When comparing errors on grids of different sizes, this norm is more
%    useful than a standard matrix norm, because it automatically adjusts
%    for changes in the number of elements in the arrays.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 September 2024
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    real X(m,n): the array.
%
%  Output:
%
%    real value: the RMS norm of the array.
%
  [ m, n ] = size ( X );

  xvec = reshape ( X, m * n, 1 );

  value = sqrt ( sum ( xvec.^2 ) / m / n );

  return
end

