How to set domain for p(x)/q(x) functions?
2 views (last 30 days)
Show older comments
My function is x-1/x-2 how can I plot this?
0 Comments
Answers (2)
Star Strider
on 23 Sep 2018
Your function has a singularity at ‘x=2’. If you simply want to plot it, this works:
x = linspace(0, 4, 250);
f = @(x) (x-1)./(x-2);
figure
plot(x, f(x))
grid
0 Comments
Basil C.
on 24 Sep 2018
You could just use this simple code instead
syms x
y=(x-1)/(x-2)
ezplot(y)
0 Comments
See Also
Categories
Find more on Symbolic Math Toolbox 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!