www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/objectivefcn1.m

    function f = objectivefcn1(x)
f = 0;
for k = -10:10
    f = f + exp(-(x(1)-x(2))^2 - 2*x(1)^2)*cos(x(2))*sin(2*x(2));
end