I have a code in Matlab, and in one step it calculates Gamma function for different values. But when I try to find Gamma(172.5) I get inf as it is bigger than realmax. My question: is there a away that I can get and calculate big numbera like Gamma (172.5) in Matlab without getting inf?
Thanks
In Matlab? No. You just tried it and surpassed the software maximum, right? If you simply want the value of the function applied to some high value you could try calculating it in other software (for instance: https://www.wolframalpha.com/input/?i=gamma%28172.5%29)
Now if you are asking it so that you can operate with such things, such as dividing such number by gamma applied to a second value and obtain the result, then it helps to remember the properties of the gamma function and see if you can come up with a way to rewrite the desired expression in matlab so that it doesn't need to evaluate such a high value.
Another way of dealing with high numbers is scaling. Imagine you have an expression full of huge numbers. Divide the expression by the biggest of them, now you only have small numbers to deal with. Solve the expression. Then multiply it back again by the maximum of the expression to obtain the desired result.