%GAUS exp(-pi*x.*x) function.
[x,y]=meshgrid(linspace(-4,4,250));
r=sqrt(x.^2+y.^2);
z1=gaus(r);% gaus function
z2=gaus((r-3)/0.2);%ring delta function
z3=gaus((r-3)/3);
z4=gaus(r/0.2); %2d delta function
subplot(2,2,1),mysurf(x,y,z1);title('gaus function');% gaussian function
subplot(2,2,2),mysurf(x,y,z2);title('ring delta function');% r-3 除以0.2 以后,值比较大,代入gaus 函数 x.^2
%之后在非r=3 的地方衰减非常快,所以可以看做是环r=3 的狄拉克函数
subplot(2,2,3),mysurf(x,y,z3);title('no name ');
subplot(2,2,4),mysurf(x,y,z4); title(' 2D delta function');
% composite function example
% comb(x)=pi*delta(sin(pi*x))
%we use gaus to simulate delta function
x2=linspace(-2,2,400);
y2=gaus(sin(pi*x2)/0.2); %1D delta function
figure,plot(x2,y2)
function y=gaus(x)
%GAUS exp(-pi*x.*x) function.
%
y=exp(-pi*