Global Optimization toolbox: "Undefined function or variable 'createOptimProblem'"

I am trying to use Global Search to solve my optimization problem. Can anyone please help me with this error? Thanks.
"Undefined function or variable 'createOptimProblem'.
Error in globalsearch (line 9)
problem = createOptimProblem('fmincon','x0',x0,..."
This is my code:
opts = optimoptions(@fmincon,'Algorithm','interior-point');
obj=@obj_fun; % objective function of the problem
cons=@nonlcon; % nonlinear constraints of the problem
lb=[0 0 0 0 0 0];
ub=[300 300 300 300 150 1];
x0=[60 30 0.05 16 50 0.5];
problem = createOptimProblem('fmincon','x0',x0,...
'objective',obj,'lb',lb,'ub',ub,'nonlcon',cons,...
'options',opts);
gs= GlobalSearch;
[x ,fval,eflag,outptg,solutions] = run(gs,problem,10);

 採用された回答

Geoff Hayes
Geoff Hayes 2015 年 11 月 24 日
Nam - do you have the Global Optimization Toolbox? In the Command Window, type
ver
to list your version of MATLAB and all installed toolboxes. Note that the createOptimProblem is mentioned in the R2014a documentation (see http://www.mathworks.com/help/releases/R2015a/gads/release-notes.html) so perhaps it was introduced in this version of the toolbox.

1 件のコメント

Nam Tran
Nam Tran 2015 年 11 月 24 日
you are right, I do not have the Global Optimization Toolbox. I thought I downloaded the version that has Global Optimization Toolbox. Thanks for the answer

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

質問済み:

2015 年 11 月 24 日

コメント済み:

2015 年 11 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by