function magic_matrix_test ( )

%*****************************************************************************80
%
%% magic_matrix_test() tests magic_matrix().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    05 December 2022
%
%  Author:
%
%    John Burkardt
%
  addpath ( '../magic_matrix' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'magic_matrix_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  Test magic_matrix()\n' );

  for n = [ 3, 5 ]
    A = magic_matrix ( n );
    fprintf ( 1, '\n' );
    fprintf ( 1, '  Magic matrix for n = %d\n', n );
    disp ( A );
    fprintf ( 1, '  Row and column sums:\n' );
    rsum = sum ( A, 1 );
    disp ( rsum );
    csum = sum ( A, 2 );
    disp ( csum' );
  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'magic_matrix_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );

  rmpath ( '../magic_matrix' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

