assigning a start point to a variable

6 views (last 30 days)
Elnaz
Elnaz on 26 Aug 2014
Edited: Elnaz on 2 Sep 2014
I am writing a ga code in matlab using predefined functions. I want to assign a value to one of my variables as a start point, so for the first run, it uses the assigned value instead of creating its own. I will be appreciated if you can guide me how to do that.
Best Elnaz

Accepted Answer

Matt J
Matt J on 26 Aug 2014
Edited: Matt J on 26 Aug 2014
This section talks about how to control the initial population
It looks like you could do it with the PopInitRange option parameter. Set lb(i)=ub(i)=yourvalue where x(i) is the variable you want to control.
  1 Comment
Elnaz
Elnaz on 2 Sep 2014
Edited: Elnaz on 2 Sep 2014
Thanks Matt, it helped me a lot. I found sth in the link you posted. 'InitialPopulation',[40] should be added to ga definition in m-file.
Best Regards
Elnaz

Sign in to comment.

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!