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

2 次查看(过去 30 天)
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 个)

Michael Haderlein
Michael Haderlein 2014-10-10
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);

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by