%% ARRAY1 evaluates an array of size M by N.
%
%  Discussion:
%
%    This script assumes the user has set M and N already.
%
%    If you run this script more than once, the later calls will run faster.
%    To restart the process, issue the "clear" command, and your next
%    run will be slow again.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    17 December 2011
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer M, N, the size of the array.
%
%    Output, integer T, the time in seconds required to set up the array.
%
%    Output, integer R, the rate, in entries per second, that the array
%    was created.
%
%    Output, real A(M,N), the actual array (probably of no interest,
%    but we make it an output argument to keep MATLAB honest.)
%
  tic
  for i = 1 : m
    for j = 1 : n
      a(i,j) = sin ( i * pi / m ) * exp ( j * pi / n );
    end
  end
  t = toc;

  r = m * n / t;

  fprintf ( 1, '\n' );
  fprintf ( 1, '  %d  %d  %f  %g\n', m, n, t, r );
