How to write x as a function of f(x)?
83 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Fabio Gavilan
el 27 de Nov. de 2019
Respondida: Star Strider
el 27 de Nov. de 2019
Hi, I was wondering if there exists some code or function to change for example:
f(x) = (x^2 - 1); or any other polynomial
to
x = sqrt(f(x) + 1) This is just an example.
Basically i would want any function written as f(x) in function of x changed to x in function of f(x).
0 comentarios
Respuesta aceptada
Star Strider
el 27 de Nov. de 2019
syms x
f(x) = (x^2 - 1);
finv = finverse(f)
producing:
finv(x) =
(x + 1)^(1/2)
To do this numerically, use the fsolve function, for example:
x = fsolve(@(x)(x.^2-1) - y, x0)
where ‘y’ is the value to solve ‘x’ for, and ‘x0’ is the intial estimate.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Polynomials en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!