why do I need to add eps ?

3 visualizaciones (últimos 30 días)
tomer polsky
tomer polsky el 2 de Sept. de 2018
Comentada: tomer polsky el 2 de Sept. de 2018
hello I want to ask why do I need to add the value eps to this code ?
x=-8:0.5:8;
y=x';
[xi,yi]=meshgrid(x,y);
r=sqrt(xi.^2+yi.^2)+eps;
z=sin(r)./r;
mesh(x,y,z,r)
becouse for some reason if I do not add eps i get a hole in the top, why is that ?

Respuestas (1)

Andrei Bobrov
Andrei Bobrov el 2 de Sept. de 2018
Editada: Andrei Bobrov el 2 de Sept. de 2018
To avoid the uncertainty of "0/0" situation when calculating z.
When x = 0 and y = 0.
  1 comentario
tomer polsky
tomer polsky el 2 de Sept. de 2018
ohh ok thank you very much

Iniciar sesión para comentar.

Categorías

Más información sobre Printing and Saving 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