how to fix a genetic algrithm function probelem

Hi, Had an error when I ran this on the matlab prompt:
??? Error using ==> preProcessLinearConstr
The number of rows in A must be the same as the length of b.
Can anyone help out ? N.B : The mfile: multiplesegments exists and has been added to path.
FitnessFunction=@multiplesegments ;
numberofVariables=20;
PopInitRange=[95 3 95 3 95 3 95 3 95 3 95 3 95 3 95 3 95 3 95 3; 115 3 115 3 115 3 115 3 115 3 115 3 115 3 115 3 115 3 115 3];
[x,fval]=ga(FitnessFunction,numberofVariables,PopInitRange)

 採用された回答

Matt J
Matt J 2014 年 9 月 22 日

0 投票

[x,fval]=ga(FitnessFunction,numberofVariables,PopInitRange)
This does not resemble the input syntax of ga() described in its documentation. You should be using the options argument in
x = ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB,nonlcon,options)
to control the PopInitRange.

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2014 年 4 月 9 日

回答済み:

2014 年 9 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by