Search code examples
matlabplotimplicitcurve

Ploting implicit function in closeness of a point


I'm given an implicit function: sin(x)*tan(x)-(y^2-3)*ln(2*y+3)=0

My task is to:

  • plot a curve of this function in closeness of a point T(0,√3)
  • find out how many unconnected components are there in x∈[-1.7, 1.7], y∈[-2, 2]

My attempt:

First I thought to just plot out the function curve using the ezplot on demanded area like so: ezplot('sin(x)*tan(x)-(y^2-3)*log(2*y+3)',[-1.7, 1.7, -2, 2]). But the result I get is very strange. I get two half’s of ellipse facing away from each other. I can only assume that I’ve used function ezplot the wrong way. Please help.


Solution

  • The ezplot commant is quite good, but other than that you could also try

    [x,y]=meshgrid(-1.7:0.01:1.7, -2:0.01:2);
    contour(x,y,sin(x).*tan(x)-(y.^2-3).*log(2*y+3),[0,0]);
    

    instead.