MATLAB: Incomplete gamma function calculation

incomplete gamma function.

Hi,
I have this equation:
gamma(5,x) = 2
how I can find the value of x?
Thanks

Best Answer

I don't believe that's possible:
gammainc(5,0)
gammainc(5,1000);
it never goes near two.
More
options = optimoptions(@fminunc,'tolfun',10^-10,'tolx',10^-12);
xv = fminunc(@(x)(gammainc(5,x)-(10^-4)).^2,4,options)
%xv =15.6926
gammainc(5,xv)
% ans =
% 1.0004e-04