How do I solve solve a function, y=f(x), for x given y?

4 views (last 30 days)
I'm new to Matlab. This seems like a very easy problem, but I don't know how to write it in Matlab. I created models for many datasets. The model takes the form y = 1/(A+exp(B*x-C))-D+1/(E+exp(F*x-G)). (The model looks like a straight line with depression in it). In the model, x is time. I want to determine how much time it takes to get halfway from the minimum to the asymptote on either side. I can put the function in Matlab, find the minimum, asymptotes, and the halfway point for the left side of the depression. I am totally stumped on how to find the the halfway point for the right side. I know what the y value is, but the 'solve' function will only return the x-value for the left side. How do I determine the time from the minimum to halfway to the asymptote on the right side? I can provide some numbers and parameter values if that would be helpful.
  1 Comment
Star Strider
Star Strider on 10 Oct 2014
Parameter values would help. Guessing at them doesn’t produce the curve you describe.

Sign in to comment.

Answers (1)

Michael Haderlein
Michael Haderlein on 10 Oct 2014
I didn't check the equation in detail, but if you know the y value you're looking for, you basically just need to find the root of equation minus y value. Assume the y value you're looking for is 3, then you can use
x=fzero(1/(A+exp(B*x-C))-D+1/(E+exp(F*x-G)) - 3,1);

Categories

Find more on Mathematics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!