unc_n2_shubert3plot.m
来自「it contains many classic Test Problems f」· M 代码 · 共 37 行
M
37 行
lb=-10;
ub=10;
teix=0.05;
[X,Y] = meshgrid(lb:teix:ub,lb:teix:ub);
%get Z;
a=1.42513;
b=0.80032;
suma=0;
for i=1:5
suma=suma+i*cos((i+1)*X+i);
end
sumb=0;
for i=1:5
sumb=sumb+i*cos((i+1)*Y+i);
end
Z=suma.*sumb+power(X+a,2)+power(Y+b,2);
% %mesh
% mesh(X,Y,Z)
% axis([lb ub lb ub -200 300]);
% title('unc#n2#shubert3');
% xlabel('x');
% ylabel('y');
% zlabel('z')
%contour
v=[ -200 -100 100];
[c,h]=contour(X,Y,Z,v);
clabel(c,h);
title('unc#n2#shubert3');
xlabel('x');
ylabel('y');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?