还有比这个函数更美妙的?
z = 1/8.*(6.*exp(-((2/3.*abs(x) - 1).^2+ (2/3.*y).^2) - 1/3*(2/3.*y + 1/2).^3) + 2/3.*exp(-2.818^11*((abs(2/3.*x) - 1).^2 + (2/3.*y).^2).^2) + 2/3.*y - (2/3.*x).^4);
% 微信公众号:数学模型(MATHmodels) % 知乎专栏:https://zhuanlan.zhihu.com/MATHmodels [x,y]=meshgrid(-3:0.03:3); z = 1/8.*(6.*exp(-((2/3.*abs(x) - 1).^2 ... + (2/3.*y).^2) - 1/3*(2/3.*y + 1/2).^3) ... + 2/3.*exp(-2.818^11*((abs(2/3.*x) - 1).^2 ... + (2/3.*y).^2).^2) + 2/3.*y - (2/3.*x).^4); I= find(sqrt((abs(x) - 3/2).^2 + y.^2) <0.45); R = 1.0*ones(size(x)); R(I)=0.9; G = 0.9*ones(size(x)); G(I)=0.6; B = 0.9*ones(size(x)); B(I)=0.6; h = surf(x,y,z,cat(3,R,G,B)); axis image shading interp camlight left;