Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
Shashank
Shashank el 20 de Nov. de 2014
Editada: Alan Weiss el 20 de Nov. de 2014
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.

Respuestas (1)

Alan Weiss
Alan Weiss el 20 de Nov. de 2014
Editada: Alan Weiss el 20 de Nov. de 2014
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

Categorías

Más información sobre Genetic Algorithm en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by