f(x,y) = (x+y+xy+1) / xy = 0
Hi, How can I plot 2D of the function above on MUPAD or Note ? It is simple 2D x, y space but I couldn't figure it out.
Thank you.

 Réponse acceptée

Star Strider
Star Strider le 7 Juin 2016

1 vote

You can do that with the Symbolic Math Toolbox and the fcontour function, setting ‘LevelList’ to a vector of zeros:
syms x y
f(x,y) = (x+y+x*y+1) / (x*y);
figure(1)
fc = fcontour(f);
fc.LevelList = [0 0];
See the documentation on fcontour for details.

5 commentaires

gunmo gu
gunmo gu le 15 Juin 2016
Modifié(e) : gunmo gu le 15 Juin 2016
Thank you for your help. I have another Question
1. How can I show X Y axis,....... 2. How can I add another function on Same figure ?
Star Strider
Star Strider le 15 Juin 2016
Use the hold function.
See the documentation on hold for details.
Matthew
Matthew le 29 Déc 2022
Maybe also use fimplicit()?
f = @(x,y)(x+y+x*y+1) / (x*y)
fimplicit(f)
Star Strider
Star Strider le 29 Déc 2022
@Matthew — Now, yes. The fimplicit function was introduced in R2016b, so it likely wasn’t available when I posted that answer.
Torsten
Torsten le 29 Déc 2022
But use
f = @(x,y)(x+y+x*y+1)
to avoid division by 0.
And the zero sets of both functions are equal.

Connectez-vous pour commenter.

Plus de réponses (1)

Ahmed
Ahmed le 16 Sep 2018

0 votes

https://www.mathworks.com/matlabcentral/answers/103972-how-to-plot-f-x-y-x-2-y-function-in-matlab

Community Treasure Hunt

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

Start Hunting!

Translated by