matlab中遗传算法的运行问题,求指教!。
이전 댓글 표시
function y = optlincontest6(x)
y = x^2+1;
options = gaoptimset('Generations',100,'PopulationSize',400);
lb=10;
ub=30;
[x,fval,exitflag] = ga(@optlincontest6,1,options);
为什么我设定x的区间为10到30,得到的最优结果是x=-8.7828e-5,y=1.0000?
哪里有错误,求指教!
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 基于问题的优化设置에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!