why do I need to add eps ?

조회 수: 6 (최근 30일)
tomer polsky
tomer polsky 2018년 9월 2일
댓글: tomer polsky 2018년 9월 2일
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 ?

답변 (1개)

Andrei Bobrov
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.
  댓글 수: 1
tomer polsky
tomer polsky 2018년 9월 2일
ohh ok thank you very much

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Elementary Math에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by