出现运行结果无法符合部分约束关系的情况,代码如下,求高手帮助,感激不尽!
%objfun.m 文件
function f = objfun(x)
f=0;
for i=1:120
for u=0:11
for v=1:9
f=f+sum((1/9999)^((250-x(i))/abs(250-x(i))))*sum(x(u*10+v+1)-x(u*10+v)-25);
end
end
end
%confun.m文件
function[c,ceq] =confun(x)
%非线性不等式约束
for n=0:11
c2 =[x(n*10+1)-x(n*10+2)+25
x(n*10+2)-x(n*10+3)+25
x(n*10+3)-x(n*10+4)+25
x(n*10+4)-x(n*10+5)+25
x(n*10+5)-x(n*10+6)+25
x(n*10+6)-x(n*10+7)+25
x(n*10+7)-x(n*10+8)+25
x(n*10+8)-x(n*10+9)+25
x(n*10+9)-x(n*10+10)+25
x(n*10+121)-x(n*10+2)+2
x(n*10+122)-x(n*10+3)+2
x(n*10+123)-x(n*10+4)+2
x(n*10+124)-x(n*10+5)+2
x(n*10+125)-x(n*10+6)+2
x(n*10+126)-x(n*10+7)+2
x(n*10+127)-x(n*10+8)+2
x(n*10+128)-x(n*10+9)+2
x(n*10+129)-x(n*10+10)+2];
end
for a=11:60
c3 =[-(x(1)-x(a))^2+1
-(x(2)-x(a))^2+1
-(x(3)-x(a))^2+1
-(x(4)-x(a))^2+1
-(x(5)-x(a))^2+1
-(x(6)-x(a))^2+1
-(x(7)-x(a))^2+1
-(x(8)-x(a))^2+1
-(x(9)-x(a))^2+1
-(x(10)-x(a))^2+1
-(x(121)-x(a))^2+1
-(x(122)-x(a))^2+1
-(x(123)-x(a))^2+1
-(x(124)-x(a))^2+1
-(x(125)-x(a))^2+1
-(x(126)-x(a))^2+1
-(x(127)-x(a))^2+1
-(x(128)-x(a))^2+1
-(x(129)-x(a))^2+1
-(x(130)-x(a))^2+1];
end
for b=21:60
c4 =[-(x(11)-x(b))^2+1
-(x(12)-x(b))^2+1
-(x(13)-x(b))^2+1
-(x(14)-x(b))^2+1
-(x(15)-x(b))^2+1
-(x(16)-x(b))^2+1
-(x(17)-x(b))^2+1
-(x(18)-x(b))^2+1
-(x(19)-x(b))^2+1
-(x(20)-x(b))^2+1
-(x(131)-x(b))^2+1
-(x(132)-x(b))^2+1
-(x(133)-x(b))^2+1
-(x(134)-x(b))^2+1
-(x(135)-x(b))^2+1
-(x(136)-x(b))^2