필터 지우기
필터 지우기

how to fix a genetic algrithm function probelem

조회 수: 1 (최근 30일)
segun
segun 2014년 4월 9일
답변: Matt J 2014년 9월 22일
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일
[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개)

카테고리

Help CenterFile Exchange에서 Genetic Algorithm에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by