Coding for X^2+2*X+1

13 ビュー (過去 30 日間)
Falguni Patel
Falguni Patel 2013 年 9 月 28 日
回答済み: Walter Roberson 2013 年 9 月 29 日
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 件のコメント
Matt J
Matt J 2013 年 9 月 28 日
編集済み: Matt J 2013 年 9 月 28 日
Help you with what part of it? You don't appear to have done anything yet.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
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.

カテゴリ

Help Center および File ExchangeGenetic Algorithm についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by