function matrix_diagonal_test ( )

%*****************************************************************************80
%
%% matrix_diagonal_test() computes a matrix diagonal using einsum().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    08 August 2026
%
%  Author:
%
%    John Burkardt
%  
  fprintf ( 1, '\n' );
  fprintf ( 1, '  matrix_diagonal_test():\n' );

  A = [ ...
    11, 12, 13; ...
    21, 22, 23; ...
    31, 32, 33 ];
  fprintf ( 1, '\n' );
  fprintf ( 1, '  A:\n' );
  disp ( A );

  D = einsum ( 'ii -> i', A );
  fprintf ( 1, '  D = einsum ( "ii -> i", A ):\n' );
  disp ( D );

  return
end

