フィルターのクリア

How to find inverse of a self written integral function?

3 ビュー (過去 30 日間)
Rajendra Gupta
Rajendra Gupta 2018 年 5 月 11 日
編集済み: Walter Roberson 2020 年 11 月 28 日
I have defined a function y=iMyF(x) containing an integral written as y=5*log10[4345*\int_0^x du/sqrt(0.3*(1+u)^2+0.7)] so that I can find y for a given value of x. How can I find x for a given value y for this function? I want to use the inverse function to fit a data set using the curve fitting tool.
  16 件のコメント
Walter Roberson
Walter Roberson 2020 年 11 月 28 日
編集済み: Walter Roberson 2020 年 11 月 28 日
Could you confirm that you want the scaled gamma incomplete and not the unscaled?
It looks plausible to me that the sqrt() could be acting on a negative value, leading to complex, but then converted to real by the abs() ? Does that sound accurate?
Walter Roberson
Walter Roberson 2020 年 11 月 28 日
I see article https://www.researchgate.net/publication/3388532_Inverse_incomplete_gamma_function_and_its_application . Perhaps some of its ideas could be used as steps in developing the expression you need. It would not be easy though.

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

採用された回答

Jeff Miller
Jeff Miller 2018 年 5 月 12 日
No doubt there are more efficient methods for your particular function, but a quick and dirty general approach is to make a function using fzero. I don't do this often, but I think it would look something like this:
function x = myinverse(y, guess)
fun = @(z) (iMyF(z)-y); % parameterized function
x = fzero(fun,guess) % guess is your initial pretty good guess for x
end
  1 件のコメント
Rajendra Gupta
Rajendra Gupta 2018 年 5 月 13 日
Thanks Jeff. It works pretty well provided the 'guess' is reasonable. Problem is when y and x are arrays. One then needs to provide 'guess' also as an array, or have a formula included in the function that can provide a pretty good value of guess for each value of y. I would also like to know more efficient methods if at all possible. Nevertheless, for now I am happy as it solved my immediate problem by embedding a formula for guess in the function.

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

その他の回答 (0 件)

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by