hold off
%% 画进化图 figure(2);
plot(1:MAXGEN,trace(3,:)); grid on
xlabel('遗传代数') ylabel('解的变化') title('进化过程') bestZ=trace(3,end); bestX=trace(1,end); bestY=trace(2,end);
fprintf(['最优解:\\nX=',num2str(bestX),'\\nY=',num2str(bestY),'\\nZ=',num2str(bestZ),'\\n'])
9 / 9

