Shubert 函数是一个二元周期函数,定义域为[-10, 10] x [-10, 10],其公式为:

f(x, y) = (cos((x+1)*1+1) + cos((x+2)*2+1) + cos((x+3)*3+1) + cos((x+4)*4+1) + cos((x+5)*5+1)) * (cos((y+1)*1+1) + cos((y+2)*2+1) + cos((y+3)*3+1) + cos((y+4)*4+1) + cos((y+5)*5+1))

在 Matlab 中的表达式为:

function z = shubert(x, y)
z = 0;
for i = 1:5
    for j = 1:5
        z = z + (i*cos((i+1)*x+1) + j*cos((j+1)*y+1));
    end
end
end

其中 x 和 y 为二维平面上的坐标,z 为函数值。


原文地址: https://www.cveoy.top/t/topic/nq0n 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录