MATLAB Answers

How to write x as a function of f(x)?

62 ビュー (過去 30 日間)
Fabio Gavilan
Fabio Gavilan 2019 年 11 月 27 日
Answered: Star Strider 2019 年 11 月 27 日
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 件のコメント

サインイン to comment.

採用された回答

Star Strider
Star Strider 2019 年 11 月 27 日
The Symbolic Math Toolbox has the finverse function:
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 件のコメント

サインイン to comment.

More Answers (0)

サインイン してこの質問に回答します。


Translated by