fmincon minimum number of iterations
64 views (last 30 days)
Show older comments
Are there any way to set minimum number of iterations in fmincon.
I don't want to stop algorithm when
options.OptimalityTolerance = 0,
options.ConstraintTolerance = 0, and
options.StepTolerance = 0.
I want fmincon to stop at the desired iterations for comparing with other algorithms.
2 Comments
Accepted Answer
Ameer Hamza
on 5 Apr 2020
This shows how you can force fmincon to keep searching until a fixed number of iterations is reached. It uses a simple objective function, but fmincon still run to 1000 iterations.
opts = optimoptions('fmincon', ...
'OptimalityTolerance', 0, ...
'StepTolerance', 0, ...
'MaxFunctionEvaluations', inf,...
'MaxIterations', 1000);
[X,f,~,out] = fmincon(@(x) x.^2, 1, [], [], [], [], [], [], [], opts);
2 Comments
More Answers (0)
See Also
Categories
Find more on Nonlinear Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!