This is Google's cache of https://www.mathworks.com/matlabcentral/answers/620508-plotting-a-symbolic-function. It is a snapshot of the page as it appeared on 21 Oct 2020 09:03:28 GMT. The current page could have changed in the meantime. Learn more.
Full versionText-only versionView source
Tip: To quickly find your search term on this page, press Ctrl+F or ⌘-F (Mac) and use the find bar.
plotting a symbolic function - MATLAB Answers - MATLAB Central

MATLAB Answers

plotting a symbolic function

20 views (last 30 days)
mogin jerry
mogin jerry about 12 hours ago
Commented: mogin jerry 23 minutes ago
i need to create symbolic function f(x) equalling ((3*x-5)/(x-3))
then make symbolic equation, invEqn, by setting x equal to f(y).
solve function to solve invEqn for y and use expression to define the symbolic function finv(x)
Plot f and f^-1 on the same axes.using fplot.
can someone write me a code not sure where to start

  0 Comments

Sign in to comment.

Answers (1)

Cris LaPierre
Cris LaPierre about 12 hours ago
Edited: Cris LaPierre about 12 hours ago
Sounds like a homework assignment, so I won't provide an answer, but take a look at the fplot function documentation page. One of the examples on that page can be used to get your started on your assignment.

  4 Comments

Show 1 older comment
Walter Roberson
Walter Roberson 14 minutes ago
The first parameter to fplot() must be a symbolic expression or symbolic function or function handle.
The second parameter to fplot() must be the range to plot over.
invEqn = x == f(x);
No,
invEqn = y == f(x);
which you need to solve for x, and the result needs to be a function of y, not a function of x (watch out for what you assign the output to!)
Note: it happens that for functions of the form (A*X-B)/(x-A) that the solution is x = (A*Y-B)/(Y-A) -- just replacing the X with Y. If you plot over the same range, you are not going to be able to tell the functions apart.
This is not something that happens in general, only for that special form. If it were (A*X-B)/(x-C) then the solution would be (C*Y-B)/(Y-A) with the constant having moved from the denominator to the numerator... but your constants are the same between numerator and denominator.
mogin jerry
mogin jerry 4 minutes ago
I NEED THE GRAPH TO LOOK SOMETHING LIKE THIS

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!