%plot the original function
interval=0.1;
[x1, x2]=meshgrid(-1.5:interval:1.5);
F = 20+x1.^2-10*cos(2*pi*x1)+x2.^2-10*cos(2*pi*x2); % F为实际计算的结果
subplot(1,3,1)
mesh(x1,x2,F);
zlim([0,60])
%plot the error 看他们之间的差异
subplot(1,3,3)
mesh(x1,x2,F-v);
zlim([0,60])