📄 fct2dlaplace.m
字号:
function z=fct2DLaplace(x,y) % Laplacian of fct2D, not completely tested
global func3d
[nx,ny]=size(x);
switch func3d
case 1
z=6-x.^2-y.^2;
if z>=0
z=4*ones(nx,1);
else
z=-4*ones(nx,1);
end
case 2 % peaks(.,.), we have to discretize
dx=max(abs(x).*1.0e-7,1.0e-7);
hxp=x+dx;
hxm=x-dx;
dy=max(abs(y).*1.0e-7,1.0e-7);
hyp=y+dy;
hym=y-dy;
z=(peaks(hxp,y)-2*peaks(x,y)+peaks(hxm,y))./(dx.*dx)+(peaks(x,hyp)-2*peaks(x,y)+peaks(x,hym))./(dy.*dy);
case 3 %2
z=4*ones(nx,1);
case 4
z=4*exp(-x.^2-y.^2).*(-1+x.^2+y.^2);
case 5
z=4*exp(-x.^2-5*y.^2).*(-3+x.^2+25*y.^2);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -