Undefined function 'ga' for input arguments of type 'function_handle'.
2 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(1 个)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genetic Algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!