Coding for X^2+2*X+1
13 次查看(过去 30 天)
显示 更早的评论
I want to maximize one variable mathematical equation x^2+2*X+1 using ga coding. so please help me to solve above equation. i have a population size is 4 number of bits=8 mutation rate=-0.5
1 个评论
回答(1 个)
Walter Roberson
2013-9-29
Code your ga routine to do nothing other than return. Once you have run ga(), throw away all of the results. Then take max() over your population; that will be the value for which X^2 +2*x + 1 is maximal.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!