Fimplicit not plotting properly

25 vues (au cours des 30 derniers jours)
Nethanel Benzaquen
Nethanel Benzaquen le 3 Déc 2020
Commenté : Walter Roberson le 3 Déc 2020
Hello,
Im trying to implicity plot conic sections using this deffinition in the app desinger.
fun1=@(x,y) a.*x.^2+2*h.*x.*y+b*y.^2+2*g.*x+2*f.*y+c;
after inputing
a=2 , 2*h=0, b=0, 2*g=3, 2*f=1, c=7
fimplicit is returning a blank graph although this is a perfectly fine parabola.
when plotting it with a linspace as such:
xx=-10:10;
yy=-2.*xx.^2-7.*xx-7;
plot(xx,yy)
Matlab plots the function perfectly fine. So why does't the fimplicit plot it aswell.
thanks

Réponse acceptée

Stephan
Stephan le 3 Déc 2020
Modifié(e) : Stephan le 3 Déc 2020
fun1=@(x,y) a.*x.^2+2*h.*x.*y+b*y.^2+2*g.*x+2*f.*y+c;
a=2;
h=0;
b=0;
g=3/2;
f=1/2;
c=7;
fimplicit(fun1,[-3 2 -12 -5])
  2 commentaires
Nethanel Benzaquen
Nethanel Benzaquen le 3 Déc 2020
Thanks!
do you know why when writting the code like this
fun1=@(x,y) a.*x.^2+2*h.*x.*y+b*y.^2+2*g.*x+2*f.*y+c;
fimplicit(app.ax1,fun1);
xlim(app.ax1,'auto')
ylim(app.ax1,'auto')
the xlim and ylim didn't work. The Idea is for any value of coefficients i should see the graph. but in this specif case it didnt show it to me
Stephan
Stephan le 3 Déc 2020
No, i also did not get it to work in an automatic way...

Connectez-vous pour commenter.

Plus de réponses (1)

Walter Roberson
Walter Roberson le 3 Déc 2020
a=2; h=0/2; b=0; g=3/2; f=1/2; c=7;
fun1=@(x,y) a.*x.^2+2*h.*x.*y+b*y.^2+2*g.*x+2*f.*y+c;
fimplicit(fun1, [-10 10 -10 10])
Looks plausible to me.
  2 commentaires
Nethanel Benzaquen
Nethanel Benzaquen le 3 Déc 2020
Thanks!
do you know why when writting the code like this
fun1=@(x,y) a.*x.^2+2*h.*x.*y+b*y.^2+2*g.*x+2*f.*y+c;
fimplicit(app.ax1,fun1);
xlim(app.ax1,'auto')
ylim(app.ax1,'auto')
the xlim and ylim didn't work. The Idea is for any value of coefficients i should see the graph. but in this specif case it didnt show it to me
Walter Roberson
Walter Roberson le 3 Déc 2020
Setting the xlim or ylim has no effect on the range that fimplicit uses to plot, and changing the limits to auto after the call does not trigger an already existing fimplicit to go back and analyze the function to find a range of bounds that will give an interesting plot. fimplicit only draws according to the range passed in or the default for the fimplicit call.
You are not passing in limits and the default limits happen to have no interesting content for this function.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by