cl; m=31; n=31; img=zeros(m+1,n+1); img=double(img); pi=3.1415926; sigma=10; for i=-(m/2):m/2 for j=-(n/2):n/2 img(i+m/2+1,j+n/2+1)=(1/(2*pi*sigma*sigma))*exp(-(i*i+j*j)/(2*sigma*sigma)); end end img=mat2gray(img); imshow(img); imwrite(img,'pic.bmp');
请发表评论