matlab遗传算法程序出错 function result=sga(n,a,b,pc,pm,e)for i=1:50if (b-a)/e>2^(i)m=i+1;elsei=i+1;endendpopusize=n;chromlength=m;j=1;popu=round(rand(popusize,chromlength));while j

来源:学生作业学帮网 编辑:学帮网 时间:2024/05/14 08:42:20

matlab遗传算法程序出错
function result=sga(n,a,b,pc,pm,e)
for i=1:50
if (b-a)/e>2^(i)
m=i+1;
else
i=i+1;
end
end
popusize=n;chromlength=m;j=1;
popu=round(rand(popusize,chromlength));
while j

newpopu(i,:)=[popu(i,1:cpoint) popu(i+1,
不能这样写,你是不是想把一行分成两行写?那么第一行末尾要加“...”的.