Contents Previous Next Subchapters Current Chapters-> erf ierf erfc beta betai gamma gammln gammainc besselj bessely besseli besselk elliprf elliprd elliprj ellipf ellipe ellipi kolsmi psi airy isprime lentz Parent Chapters-> Omatrix6 special gamma Search Tools-> contents reference index search

The Gamma Function
 Syntax `gamma(`x`)` See Also gammln , gammainc , factorl

Description
Returns the element-by-element gamma function, where x is a an integer, real, double-precision, or complex matrix such that the real part of each element of x is greater than 0. The return value has the same dimension as x. If x is integer, the return value is double-precision, otherwise it has the same type as x.

Gamma Function
The gamma function is defined by ```                 +inf                 /   - t  (x - 1)      gamma(x) = |  e    t       dt                 /                 0 ```You can use integration by parts to note that if x is equal to an integer greater than zero, ```      gamma(x) = (x - 1) ! ```
Example
If you enter ```      x = seq(4)      gamma(x) ``` O-Matrix will reply ```      {      1      1      2      6      } ```