function r8mat_diagonal_test ( )

%*****************************************************************************80
%
%% R8MAT_DIAGONAL_TEST tests R8MAT_DIAGONAL.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    02 August 2018
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'R8MAT_DIAGONAL_TEST\n' );
  fprintf ( 1, '  R8MAT_DIAGONAL returns a matrix with given diagonal.\n' );

  n = 4;
  d = [ 11.0, 22.0, 33.0, 44.0 ];
  r8vec_print ( n, d, '  Desired diagonal entriesss:' );

  a = r8mat_diagonal ( n, d );

  r8mat_print ( n, n, a, '  Matrix with given diagonal:' );

  return
end
