% Boundary constraints
function s=simplebounds(s,Lb,Ub)
% Apply the lower bound
ns_tmp=s;
Num=size(Lb,2);
for i=1:Num
if ns_tmp(i)<Lb(i)
ns_tmp(i)=Lb(i);
end
if ns_tmp(i)>Ub(i)
ns_tmp(i)=Ub(i);
end
s=ns_tmp;
end
end
边界处理函数 每一维的大小不一样
最新推荐文章于 2024-07-30 11:28:17 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)