incomplete gamma function calculation

2 ビュー (過去 30 日間)
Jamal Ahmad
Jamal Ahmad 2013 年 5 月 24 日
Hi,
I have this equation:
gamma(5,x) = 2
how I can find the value of x?
Thanks
  2 件のコメント
José-Luis
José-Luis 2013 年 5 月 24 日
Matlab's gamma function only accepts one input argument.
Jamal Ahmad
Jamal Ahmad 2013 年 5 月 24 日
this is incomplete gamma function, in matlab we can write as the following:
gammainc(a,x)
a = 5 and the result of the above function is 2 I need the value of x.

サインインしてコメントする。

採用された回答

Sean de Wolski
Sean de Wolski 2013 年 5 月 24 日
編集済み: Sean de Wolski 2013 年 5 月 24 日
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
  7 件のコメント
Jamal Ahmad
Jamal Ahmad 2013 年 5 月 24 日
Thank you very much. I use R2012a. Now it works.
options = optimset('tolfun',10^-10,'tolx',10^-12); xv = fminunc(@(x)(gammainc(5,x)-(10^-4)).^2,4,options) gammainc(5,xv)
Jamal Ahmad
Jamal Ahmad 2013 年 5 月 24 日
now I have this warning:
Warning: Gradient must be provided for trust-region algorithm; using line-search algorithm instead. > In fminunc at 367 In test_2 at 12

サインインしてコメントする。

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 5 月 24 日
It appears to me that you will need to proceed numerically.
  1 件のコメント
Jamal Ahmad
Jamal Ahmad 2013 年 5 月 24 日
sure, but how

サインインしてコメントする。


Matt J
Matt J 2013 年 5 月 24 日
xv = fzero(@(z) gammainc(5,z.^2)- 2 , sqrt(xguess)).^2;

カテゴリ

Help Center および File ExchangeGamma Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by