Genetic Algorithm problem: initial population size

12 views (last 30 days)
when I ran my optimization using ga, I got the following error: Any suggestions will be appreciated.
Error using validate (line 201) Incorrect size of InitialPopulation.
Error in gacommon (line 72) [options,nvars,FitnessFcn,NonconFcn] = validate(options,type,nvars,fun,nonlcon,user_options);
Error in ga (line 319) [x,fval,exitFlag,output,population,scores,FitnessFcn,nvars,Aineq,bineq,Aeq,beq,lb,ub, ...

Answers (1)

Alan Weiss
Alan Weiss on 25 Jul 2014
Did you give an initial population? Did it match the number of variables that you passed to GA?
For more detailed help, please show us your options and your call to GA. And perhaps tell us how many variables your fitness funtion is expecting.
Alan Weiss
MATLAB mathematical toolbox documentation
  15 Comments
Walter Roberson
Walter Roberson on 14 Apr 2018
I will look at this later. I need to do other things for a while.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!