why do I need to add eps ?
4 次查看(过去 30 天)
显示 更早的评论
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 ?
0 个评论
回答(1 个)
Andrei Bobrov
2018-9-2
编辑:Andrei Bobrov
2018-9-2
To avoid the uncertainty of "0/0" situation when calculating z.
When x = 0 and y = 0.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Printing and Saving 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!