필터 지우기
필터 지우기

Undefined function 'ga' for input arguments of type 'function_handle'.

조회 수: 2 (최근 30일)
Shashank
Shashank 2014년 11월 20일
편집: Alan Weiss 2014년 11월 20일
Hi,
I have 2014a version of matlab on my mac. I am trying to solve a MILP using ga. The global optimization toolbox is installed on my system, and I also have the license for it. But when I try to run the ga, I get the following error:
Undefined function 'ga' for input arguments of type 'function_handle'.
A snippet from my code:
fn = @(x) f'*x;
[x,fval,exitflag]=ga(fn,2*n^2,A,b,Aeq,beq,lb,ub,[],intcon);
I don't know how to debug it, since documentations says that I need to supply a function handle here.

답변 (1개)

Alan Weiss
Alan Weiss 2014년 11월 20일
편집: Alan Weiss 2014년 11월 20일
Try entering
which -all ga
Perhaps there is another ga file that is getting precedence.
Even better, use intlinprog rather than ga for much better performance and reliability.
Alan Weiss
MATLAB mathematical toolbox 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