Error message running ga solver

Hello:
I get a error message every time I run the Genetic algorithm in Optimization Tool, the message is generated in the result window as follow:
-----------------------------
Optimization running.
Error running optimization.
Undefined function 'isoptimargdbl' for input arguments of type 'cell'.
The Fitness function I'm trying to solve was saved in a M-file:
function t = z(x)
t = @(x) (x-10)^2;
%ezplot (t,[0,20])
Settings of the solvers are:
Fitness function: z
Number of variable: 1
Bounds: Lower: -5 Upper: 35
Others left blank.
The error message was produced after I click Start.
I was running Matlab on my PC, Student version, R2012a, The Glolbal optimization toolbox license is purchased separately. Optimization toolbox 6.2, input license('inuse') in the command window shows sr_gads_toolbox sr_matlab sr_optimization_toolbox
The strange thing is if I ran the solver in Matlab on computers in the university, the same fitness function with same settings, the optimum point could be found and no error message is generated.
What is likely to go wrong? Please help, Thank you in advance.
Philip

 Respuesta aceptada

Philip
Philip el 26 de Mzo. de 2013

0 votos

Hello:
Thank you for your help!
The problem occurred due to capability issue, I ran the Global Optimization Toolbox 3.2.3 on MATLAB version 2012a, which should work under MATLAB version 2013a.
Best regards Philip

Más respuestas (1)

Alan Weiss
Alan Weiss el 22 de Mzo. de 2013

0 votos

I am afraid that I don't really understand what you are doing, but I will give a try.
Your objective function always returns a function handle, not a real value, as you can easily check:
ff = z(3)
ff =
@(x)(x-10)^2
If you really have a 1-dimensional problem, you can set
z = @(x) (x-10).^2
But I might be misunderstanding you entirely. In any case, plese make sure that your fitness function returns a real value or a real vector. Here is the documentation of fitness functions.
Alan Weiss
MATLAB mathematical toolbox documentation

2 comentarios

Philip
Philip el 22 de Mzo. de 2013
Hello Alan,
thank you for your help, I tried your suggestion and have read the Global Optimization User Guide,too. I tried the example fitness function provided in the user guide, Matlab returns the seem error message:
EDU>> [x fval] = ga(@z, 1)
Undefined function 'isoptimargdbl' for input arguments of type 'cell'.
Error in ga (line 313)
msg = isoptimargdbl('GA', {'NVARS','A', 'b', 'Aeq','beq','lb','ub'}, ...
I tried the same fitness function with same settings on those PCs on campus, no error message was generated. (BTW, simulated annealing have no problem solving this objective function) This leads me to think there might be a problem with my Matlab software itself. I'm contacting Matlab support, and will come back to report the result.
Ezio Cosatto
Ezio Cosatto el 5 de Sept. de 2014
I had the same error using Optimization Toolbox ver 6.2.1 with Matlab 8.0.0.783 (R2012b):
Undefined function 'isoptimargdbl' for input arguments of type 'cell'.
Error in fsolve (line 143) msg = isoptimargdbl('FSOLVE', {'X0'}, x);
Error in meanflow (line 199) X=fsolve(@syst, initguess, options, U1, p1, rho1, T1, mf, Qcalc, kdrop, Nc, m_jump, fl, mfc, Sc, Uc, split, spl_ratio, beta);
Could you tell me if it's something which depends on the sw versions? When I used the same code with Matlab R2012a I didn't get any error.

Iniciar sesión para comentar.

Preguntada:

el 21 de Mzo. de 2013

Comentada:

el 5 de Sept. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by