Empty keys error in using optimoptions
조회 수: 2 (최근 30일)
Hey guys! I am working on Genetic algorithm recently. And I met some problems when using fmincon.
I got error when calling the following line of code.
options = optimoptions(@fmincon,'OutputFcn',@outfun,...
Empty keys are not allowed in this container.
Error in my_fmincon (line 24)
where budget is 10000, outfun is deined in this way:
function stop = outfun(x,optimValues,state)
stop = false;
% Concatenate current point and objective function
% value with history. x must be a row vector.
history.fval = [history.fval; optimValues.fval];
history.x = [history.x; x];
% Concatenate current search direction with
% searchdir = [searchdir;...
% Label points with iteration number and add title.
% Add .15 to x(1) to separate label from plotted 'o'
% title('Sequence of Points Computed by fmincon');
Help! Thanks a lot!!
Aman Vyas 2020년 8월 14일
You can re run the installer and add "Global Optimization toolbox" in your installation procedure, as this solution resolved errors for many.
Also you can take look at this answer.
Hope it helps !