在运行下面这段代码的时候一直报错,说 'flagb' 无法识别,想问一下这样写错在哪里啊?
if i==length(location0)
numb=find(route>cusnum);
for j=1:numb
if j>1
routepart=route(numb(j-1):numb(j));
routepart(routepart==chrom(location0(j-1)))=[];
routepart(routepart==chrom(location0(j)))=[];
if isempty(routepart)
flagb=j-1;
break
end
routepart=[];
end
end
route(route==numb(flagb):end)=[];
end
报错界面是这样的: