Fimplicit not plotting properly

27 visualizaciones (últimos 30 días)
Nethanel Benzaquen
Nethanel Benzaquen el 3 de Dic. de 2020
Comentada: Walter Roberson el 3 de Dic. de 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

Respuesta aceptada

Stephan
Stephan el 3 de Dic. de 2020
Editada: Stephan el 3 de Dic. de 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 comentarios
Nethanel Benzaquen
Nethanel Benzaquen el 3 de Dic. de 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 el 3 de Dic. de 2020
No, i also did not get it to work in an automatic way...

Iniciar sesión para comentar.

Más respuestas (1)

Walter Roberson
Walter Roberson el 3 de Dic. de 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 comentarios
Nethanel Benzaquen
Nethanel Benzaquen el 3 de Dic. de 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 el 3 de Dic. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Line Plots en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by