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

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 Commento

Parameter values would help. Guessing at them doesn’t produce the curve you describe.

Accedi per commentare.

Risposte (1)

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);

Categorie

Scopri di più su Mathematics in Centro assistenza e File Exchange

Richiesto:

il 10 Ott 2014

Commentato:

il 10 Ott 2014

Community Treasure Hunt

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

Start Hunting!

Translated by