Borrar filtros
Borrar filtros

How can i solve this equation to n ?

1 visualización (últimos 30 días)
Nick
Nick el 3 de Feb. de 2012
Editada: T el 11 de Oct. de 2013
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?

Respuestas (4)

Walter Roberson
Walter Roberson el 3 de Feb. de 2012
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 comentario
Sean de Wolski
Sean de Wolski el 3 de Feb. de 2012
Definitely more optimized than mine. One comment: gammainc() expects (x,a) not(a,x).

Iniciar sesión para comentar.


Sean de Wolski
Sean de Wolski el 3 de Feb. de 2012
fzero(@(n)1-(gammainc(x,a)/gamma(n))-R,5)
Maybe? You'll hit overflow if you start with a big n.

Nick
Nick el 13 de Feb. de 2012
Thank you for your answers...

Nick
Nick el 14 de Feb. de 2012
Also, why to put the number 5 to the fzero ? Did you put it randomly ?

Categorías

Más información sobre Gamma Functions en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by