unc_nn_griewangkplot.m
来自「it contains many classic Test Problems f」· M 代码 · 共 31 行
M
31 行
%the dimension is two ,n=2;
clear
clc
lb=-600;
ub=600;
teix=2;
[X,Y] = meshgrid(lb:teix:ub);
Z=(X.*X+Y.*Y)/4000-cos(X).*cos(Y/sqrt(2))+1;
% % % mesh
% mesh(X,Y,Z)
% axis([lb ub lb ub -10 200]);
% title('unc#nn#Griewangk');
% xlabel('x');
% ylabel('y');
% zlabel('z')
% % contour
v=[ 0 0.1 0.5 1 7 10 50 100 150 ];
[c,h]=contour(X,Y,Z,v);
clabel(c,h);
title('unc#nn#Griewangk');
xlabel('x');
ylabel('y');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?