matlab程序显示错误Illegal use of reserved keyword "for".不知道怎么修改啊?求高手指点
fori=1:numMuts,mut_probability=mutOps(i,3);forj=1:mutOps(i,1),if(mut_probability>=ran...
for i=1:numMuts,
mut_probability =mutOps(i,3);
for j=1:mutOps(i,1),
if( mut_probability>=rand())
a = round(rand*(popSize-1)+1);
c1(1:mutOps(i,2))= inversionMutation(endPop(a,1:mutOps(i,2)));
if c1(1:numVar)==endPop(a,(1:numVar))
c1(xZomeLength)=endPop(a,xZomeLength);
else
c1(1:xZomeLength-1) =round(c1(1:xZomeLength-1));
[c1 c1(xZomeLength)] = fitness(c1,[gen evalOps]);
c1(xZomeLength)];
end
endPop(a,:)=c1;
end
end
end 展开
mut_probability =mutOps(i,3);
for j=1:mutOps(i,1),
if( mut_probability>=rand())
a = round(rand*(popSize-1)+1);
c1(1:mutOps(i,2))= inversionMutation(endPop(a,1:mutOps(i,2)));
if c1(1:numVar)==endPop(a,(1:numVar))
c1(xZomeLength)=endPop(a,xZomeLength);
else
c1(1:xZomeLength-1) =round(c1(1:xZomeLength-1));
[c1 c1(xZomeLength)] = fitness(c1,[gen evalOps]);
c1(xZomeLength)];
end
endPop(a,:)=c1;
end
end
end 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询