Error message running ga solver

6 views (last 30 days)
Philip
Philip on 21 Mar 2013
Commented: Ezio Cosatto on 5 Sep 2014
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

Accepted Answer

Philip
Philip on 26 Mar 2013
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

More Answers (1)

Alan Weiss
Alan Weiss on 22 Mar 2013
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 Comments
Philip
Philip on 22 Mar 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 on 5 Sep 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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!