home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l450 / 1.ddi / MATPAK.1 / arc / BESSEL.M < prev    next >
Encoding:
Text File  |  1989-01-22  |  1.3 KB  |  35 lines

  1. function ans = bessel(alpha,x)
  2. %BESSEL There are four different M-files for Bessel functions.
  3. %       BESSEL(nu,x) is the Bessel function J-sub-nu (x) for 
  4. %       every point in array x.  The order nu must be a
  5. %       scalar, but not necessarily an integer.  BESSEL is a
  6. %       driver that selects BESSELN if nu is an integer and
  7. %       BESSELA otherwise.
  8. %
  9. %       BESSELN(n,x) for integer order n, returns J-sub-n (x),
  10. %       the Bessel function of the first kind.
  11. %
  12. %       BESSELA(nu,x) for noninteger order nu, returns J-sub-nu (x).
  13. %       Warning: BESSELA(nu,x) may be inaccurate if both nu and x
  14. %       are greater than 50.  See BESSELA for more details.
  15. %
  16. %       BESSELH(n,x) for integer order n, returns H-sub-n (x),
  17. %       the complex Hankel function, J-sub-n (x) + i * Y-sub-n (x).
  18. %
  19. %    Modified Bessel functions of integer order are just the usual
  20. %    Bessel functions evaluated with purely imaginary arguments.
  21.  
  22.  
  23. %       C.B. Moler 1-19-86
  24. %       Revised 7-13-87 CBM
  25. %       Copyright (c) 1986, 1987 by the MathWorks, Inc.
  26.  
  27. if alpha == round(alpha) & ~any(any(imag(x)))
  28.         ans = besseln(alpha,x);
  29. else
  30.         if max(alpha,norm(x,inf)) > 25
  31.                 disp('Results may be inaccurate.  See BESSELA.')
  32.         end
  33.         ans = bessela(alpha,x);
  34. end
  35.