I want to draw the graph of function f(x)=x^2-1/x^2-4
This is my code:
clearclff=@(x)((x.^2)-1)./((x.^2)-4);xa=-10; xb=10; s=0.05; ya=-5; yb=5;xv=linspace(xa,-s); xh=linspace(s,xb);plot(xv,f(xv),'blue',xh,f(xh),'blue','linewidth',2)axis equal, axis([xa xb ya yb]), grid onxlabel('x'), ylabel('y'), title('function')hold on
However when draw it, it comes out wrong. It has two blue lines where the x asymptotes should be.
Best Answer