Not Enough Input Arguments in GA

조회 수: 2 (최근 30일)
nesrine nesrine
nesrine nesrine 2014년 8월 14일
댓글: Star Strider 2014년 8월 15일
function L=ga1(x)
load FM.mat;
load L0.mat;
load Lmsd.mat;
load Lrst.mat;
FM=FM(:,1);
L0=L0(:,1);
Lrst=Lrst(:,1);
Lmsd=Lmsd(:,1);
FT=x(1)*L0+x(2)*Lrst+x(3)*Lmsd;
L=abs(FM-FT);
end
Hi,
I have this problem when i run my genetic algorithm. At the first time it works but when i run again it return : Not Enough Input Arguments
I want a help to find a solution
Thanks

답변 (2개)

Hikaru
Hikaru 2014년 8월 15일
You have to define the variable x before you run this program.
The error "Not Enough Input Arguments" means that MATLAB doesn't know what the values in the brackets in the first line are.

Star Strider
Star Strider 2014년 8월 15일
How are you calling the ga function? You have to tell ga the length of x.
  댓글 수: 2
nesrine nesrine
nesrine nesrine 2014년 8월 15일
편집: nesrine nesrine 2014년 8월 15일
How can I tell the ga about the length of x kowing that i use the optimal toolbox
Star Strider
Star Strider 2014년 8월 15일
That’s given in the second argument to the ga function, termed ‘nvars’ in the documentation.

댓글을 달려면 로그인하십시오.

카테고리

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