I am trying to plot a function with a line through y=0 too.
I wrote this code:
x=0:0.01:10*pi;plot(x,2*sin(x).*exp(-x/4));hold ony=0;plot(x,y)
This is only giving me a curve and no line through y=0.
I am getting the y=0 line with this code:
x=0:0.01:10*pi;plot(x,2*sin(x).*exp(-x/4));hold ony=zeros(length(x));plot(x,y)
So what is happening with the pervios code? Doesnt y=0; make any sense here?
Best Answer