How to set domain for p(x)/q(x) functions?

2 ビュー (過去 30 日間)
Ayesha Marriyam
Ayesha Marriyam 2018 年 9 月 23 日
回答済み: Basil C. 2018 年 9 月 24 日
My function is x-1/x-2 how can I plot this?

回答 (2 件)

Star Strider
Star Strider 2018 年 9 月 23 日
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

Basil C.
Basil C. 2018 年 9 月 24 日
You could just use this simple code instead
syms x
y=(x-1)/(x-2)
ezplot(y)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by