Matlab问题,错误Incomplete or misformed expression or statement.while (abs(costminold2-costminold1);100)&(abs(costminold1-costmin);100)&(increase;500)出现如题的错误,请高手解决!Incomplete or misformed expression or statement.别人的

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/27 12:30:17
Matlab问题,错误Incompleteormisformedexpressionorstatement.while(abs(costminold2-costminold1);100)&(abs(c

Matlab问题,错误Incomplete or misformed expression or statement.while (abs(costminold2-costminold1);100)&(abs(costminold1-costmin);100)&(increase;500)出现如题的错误,请高手解决!Incomplete or misformed expression or statement.别人的
Matlab问题,错误Incomplete or misformed expression or statement.
while (abs(costminold2-costminold1);100)&(abs(costminold1-costmin);100)&(increase;500)
出现如题的错误,请高手解决!
Incomplete or misformed expression or statement.
别人的程序,忘细看
costminold2=200000;costminold1=150000;resultcost=100000;
tourminold2=zeros(1,N);
tourminold1=zeros(1,N);
resulttour=zeros(1,N);
while (abs(costminold2-costminold1);100)&(abs(costminold1-costmin);100)&(increase;500)
costminold2=costminold1; tourminold2=tourminold1;
costminold1=costmin;tourminold1=tourmin;
increase=increase+1;
if resultcost>costmin
resultcost=costmin;
resulttour=tourmin;
resultincrease=increase-1;
end
for i=1:ngpool,
cost(i)=sum(diag(distance(gpool(i,:)',rshift(gpool(i,:))')));
end
% record current best solution
[costmin,idx]=min(cost);
tourmin=gpool(idx,:);

Matlab问题,错误Incomplete or misformed expression or statement.while (abs(costminold2-costminold1);100)&(abs(costminold1-costmin);100)&(increase;500)出现如题的错误,请高手解决!Incomplete or misformed expression or statement.别人的
表达式有错.while后面应该是逻辑数进行与运算,不知道你后面一串是什么数.为啥用分号?
应该是while中的那个分号有问题.