How to get the inverse function when it's only 1-1 in certain range?
3 views (last 30 days)
Show older comments
I have a function f which is not one to one globally, but it is so on [0,1]. Now I want to compute the inverse function g of f on [0,1]. But finverse gives me the part on the range I don't need. How to deal with it? Below is the example:
phi=@(m,z)m*z^(m-1)-(m-1)*z^(m);
phi2=@(z)phi(2,z);
iphi2=matlabFunction(finverse(phi2(z)))
0 Comments
Answers (2)
Star Strider
on 8 Apr 2016
I would just use fzero instead.
If ‘phi_d’ is your desired value and you want to see what value of ‘z’ produces it, this works:
phi_d = 0.5;
z_inv = fzero(@(z) phi2(z)-phi_d, 0.1);
Here, ‘z_inv’ is about 0.293.
0 Comments
Roger Stafford
on 8 Apr 2016
As you have defined iphi2 it is simply one of the two solutions to a quadratic equation:
z = 1-sqrt(1-phi2)
0 Comments
See Also
Categories
Find more on Polynomials 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!