Plot Gamma Function

Use fplot to plot the gamma function and its inverse. The gamma function increases quickly for positive arguments and has simple poles at all negative integer arguments (as well as 0). The function does not have any zeros. Conversely, the inverse gamma function has zeros at all negative integer arguments (as well as 0).

fplot(@gamma)
hold on
fplot(@(x) 1./gamma(x))
legend('\Gamma(x)','1/\Gamma(x)')
hold off
grid on

X — Input arrayscalar | vector | matrix | multidimensional array

More About

Gamma Function

The gamma function is
defined for real x > 0 by the integral:

Γ(x)=∫0∞e−ttx−1dt

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

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

The domain of the gamma function extends
to negative real numbers by analytic continuation, with simple poles
at the negative integers. This extension arises from repeated application
of the recursion relation