Skip to Main Content Skip to Search
Product Documentation

gamma - Gamma function

Syntax

Y = gamma(X)

Definitions

The gamma function is defined by the integral:

The gamma function interpolates the factorial function. For integer n:

gamma(n+1) = n! = prod(1:n)

Description

Y = gamma(X) returns the gamma function at the elements of X. X must be real.

Algorithms

The computation of gamma is based on algorithms outlined in [1]. Several different minimax rational approximations are used depending upon the value of A.

References

[1] Cody, J., An Overview of Software Development for Special Functions, Lecture Notes in Mathematics, 506, Numerical Analysis Dundee, G. A. Watson (ed.), Springer Verlag, Berlin, 1976.

[2] Abramowitz, M. and I.A. Stegun, Handbook of Mathematical Functions, National Bureau of Standards, Applied Math. Series #55, Dover Publications, 1965, sec. 6.5.

See Also

gammainc | gammaincinv | gammaln | psi

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS