gamma

Gamma special function

📝 Syntax

  • R = gamma(M)

📥 Input argument

  • M - a real single or real double matrix.

📤 Output argument

  • R - result of gamma function.

📄 Description

gamma computes the gamma function.

The gamma function is defined by the integral: Γ(z)=0tz1etdt\Gamma(z) = \int_0^{\infty} t^{z-1} e^{-t} \, dt

for Re(z)>0\text{Re}(z) > 0

The gamma function extends the factorial function to real and complex numbers: Γ(n)=(n1)!\Gamma(n) = (n-1)!

for positive integers nn

Key properties include:

  • Γ(z+1)=zΓ(z)\Gamma(z+1) = z\Gamma(z) (recurrence relation)

  • Γ(1/2)=π\Gamma(1/2) = \sqrt{\pi}

💡 Example

R = gamma([-pi:0.1:pi])

🔗 See also

gammaln, factorial.

🕔 History

Version
📄 Description

1.0.0

initial version

Last updated

Was this helpful?