Run fmincon multiple time
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi
I am trying to maximize an function(x,y) over (x,y)
x^2+y^2+b, subject to 0<x<1 and 0<y<1. and b is between 0 and 20.
Now, I want to run fmincon on this function 20 times (for b=0, b=1, b=2..... and so on). I also want to save the optimal (x,y) with the coresponding b so that I can plot this function later.
I have looked up ( http://www.mathworks.com/help/optim/ug/nonlinear-equality-and-inequality-constraints.html ), How should I modify the code so that it will do the above?
5 commentaires
Réponse acceptée
Matt J
le 24 Août 2014
Modifié(e) : Matt J
le 24 Août 2014
[xy, fval]=quadprog(-eye(2),[0;0],[],[],[],[],[0;0],[1;1])
b=0:20;
fval=fval+b;
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Surrogate Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!