필터 지우기
필터 지우기

Not enough input arguments

조회 수: 3 (최근 30일)
Rakesh Jain
Rakesh Jain 2017년 2월 23일
댓글: Walter Roberson 2017년 2월 23일
I simply did copy and paste of the program given in the following link as below. But it is showed an error "Not enough input arguments'
function y = simple_fitness(x)
y = 100 * (x(1)^2 - x(2)) ^2 + (1 - x(1))^2
FitnessFunction = @simple_fitness
numberOfVariables = 2
[x,fval] = ga(FitnessFunction,numberOfVariables)
What is the mistake which I am doing ?
  댓글 수: 3
Rakesh Jain
Rakesh Jain 2017년 2월 23일
Instead of running in a command window, can I make a separate file of it and then run it?
Walter Roberson
Walter Roberson 2017년 2월 23일
Yes, you need to put functions into files; you cannot use the "function" keyword at the command line.

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

답변 (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