The "run" command does not work in GARDER.
显示 更早的评论
A script using Multi Start to search for a global minimum works in MATLAB, but an error appears in GARDER:
Error: You may not use the command(s) run in your code
Why does this happen, and how can you prevent it?
kol101=@(x)x.^2+2*sin(x.^2)+exp(-x);
opts = optimoptions(@fmincon,'Algorithm','sqp');
problem = createOptimProblem('fmincon','objective',...
kol101,'x0',3,'lb',1.2,'ub',4.8,'options',opts);
ms = MultiStart;
[xmin,fmin,flaga] = run(ms,problem,20)
fplot(kol101,[1.2,4.8])
hold on
plot(xmin,fmin,'rp')
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Matrix Inequalities 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
