MATLAB: How to find inverse of a self written integral function

Curve Fitting Toolboxinverse functionSymbolic Math Toolbox

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.

Best Answer

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
Related Question