function besselj_matlab_test ( )

%*****************************************************************************80
%
%% BESSELJ_MATLAB_TEST tests MATLAB's BESSELJ function.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    13 January 2016
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'BESSELJ_MATLAB_TEST:\n' );
  fprintf ( 1, '  MATLAB''s BESSELJ functio evaluates \n' );
  fprintf ( 1, '  the Bessel Jn function for NONINTEGER order.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '        NU            X               besselj(nu,x)             Tabulated\n' );
  fprintf ( 1, '\n' );

  n_data = 0;

  while ( true )

    [ n_data, n, x, fx2 ] = bessel_jx_values ( n_data );

    if ( n_data == 0 )
      break
    end

    fx1 = besselj ( n, x );

    fprintf ( 1, '  %12f  %12f  %24.16g  %24.16g\n', n, x, fx1, fx2 );

  end

  return
end
