How can i solve this equation to n ?
1 次查看(过去 30 天)
显示 更早的评论
I try to solve this equation 1-(γ(a,x)/(n-1)!)=R to n but i can't find how, where R>=0 and γ(a,x) is the lower incomplete gamma function as i found. Does anyone have any idea?
0 个评论
回答(4 个)
Walter Roberson
2012-2-3
If 1-(γ(a,x)/(n-1)!)=R then 1 + R = y(a,x) / (n-1)! and so
(n-1)! = y(a,x) / (1 + R);
(n-1)! is gamma(n), so you want to solve gamma(n) = y(a,x) / (1+R)
c = gammainc(a,x) / (1+R);
fzero( @(n) gamma(n) - c, 5 )
1 个评论
Sean de Wolski
2012-2-3
Definitely more optimized than mine. One comment: gammainc() expects (x,a) not(a,x).
Sean de Wolski
2012-2-3
fzero(@(n)1-(gammainc(x,a)/gamma(n))-R,5)
Maybe? You'll hit overflow if you start with a big n.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gamma Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!