function pgma_read_test ( file_name )

%*****************************************************************************80
%
%% pgma_read_test() tests pgma_read().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    15 May 2017
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'pgma_read_test():\n' );
  fprintf ( 1, '  pgma_read() reads an ASCII PGMA file.\n' );

  gray = pgma_read ( file_name );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  PGMA_READ was able to read the ASCII PGMA file.\n' );

  [ nrow, ncol ] = size ( gray );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Number of rows =    %d\n', nrow );
  fprintf ( 1, '  Number of columns = %d\n', ncol );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Sample data:\n' );
  fprintf ( 1, '\n' );

  for k = 1 : 10
    i = floor ( ( ( 10 - k ) * 1 + ( k - 1 ) * nrow ) / ( 10 - 1 ) );
    j = floor ( ( ( 10 - k ) * 1 + ( k - 1 ) * ncol ) / ( 10 - 1 ) );
    fprintf ( 1, '%4d  %4d  %6d\n', i, j, gray(i,j) );
  end

  return
end
