필터 지우기
필터 지우기

Dsat type error in GA optimization

조회 수: 2 (최근 30일)
Mayank
Mayank 2013년 5월 7일
댓글: Sanaz 2015년 6월 7일
I'm using ga at command line to perform optimization. The syntax is as follows: [Go,fval,exitflag,output] = ga(@fuel_eco,nvars,A,b,LB,UB,option) "fuel_eco" is a function which most certainly returns a double value. Yet when I run the code, an error pops up saying: GA only accepts inputs of data type double
Where might the problem lie? Kindly help, I'm grappling with this problem for a long time now.

채택된 답변

Alan Weiss
Alan Weiss 2013년 5월 7일
Your problem has a very simple solution. As detailed in the function reference page, the proper syntax for GA is
ga(fitnessfcn,nvars,A,b,Aeq,beq,LB,UB,nonlcon,options)
You are missing the Aeq, beq entries. As explained in the function reference page, if they don't exist for your problem, replace them with [].
Alan Weiss
MATLAB mathematical toolbox documentation
  댓글 수: 1
Sanaz
Sanaz 2015년 6월 7일
thanks so great answer

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by