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
채택된 답변
추가 답변 (1개)
Alan Weiss
2013년 3월 22일
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
Philip
2013년 3월 22일
Ezio Cosatto
2014년 9월 5일
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.
카테고리
도움말 센터 및 File Exchange에서 Genetic Algorithm에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!