MATLAB How to write factorial in matlab

  • Thread starter Thread starter adnan jahan
  • Start date Start date
  • Tags Tags
    Factorial Matlab
AI Thread Summary
To compute the factorial of rational numbers in MATLAB, the Gamma function is recommended as it extends the factorial concept to non-integer values. The Gamma function is defined such that for any positive integer n, Gamma(n) equals (n-1)!. For rational numbers, the relationship can be expressed as Gamma(x + 1) = x!. Users are encouraged to explore the integral formulation of the factorial function and consider using Gauss-Laguerre polynomials for implementation. This approach allows for the calculation of factorials for values like 0.1 or 0.2 effectively.
adnan jahan
Messages
93
Reaction score
0
Dear Fellows,

I want to write rational numbers factorial in my MATLAB program

for integers factorial command is

factorial(n)

but for rational numbers such as 0.1 or 0.2
this command is not working can anyone guide me to solve this issue ?

Regards
 
Physics news on Phys.org
Have you tried to find the integral formulation of the factorial function... from there it should be fairly easy to program it in using Gauss-Laguerre polynomials...
 
Yess I found function for Integer that is ,
for n=8
factorial(8)
but I need for any (0.1)
can you please write it here so that I can understand and use
 
Lookup the Gamma function
 
Back
Top