f19_fitness.m

来自「无线传感器网络数学优化模型程序」· M 代码 · 共 21 行

M
21
字号
function y=F19_FITNESS(x)
global dimension
global popsize
c=[1 1.2 3 3.2];
p=[0.3689 0.4699 0.1091 0.03815;0.117 0.4387 0.8732 0.5743;0.2673 0.747 0.5547 0.8828];
a=[3 0.1 3 0.1;10 10 10 10;30 35 30 35];
t=0;
for i=1:4
    A=p(:,i);
    A1=repmat(A,1,popsize);
    B=a(:,i);
    B1=repmat(B,1,popsize);
    C=x-A1;
    C1=(C.^2).*B1;
    C2=sum(C1);
    C3=exp(-C2);
    D=c(1,i)*C3;
    D1=-D;
    t=t+D1;
end
y=t;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?