How to take input from a function file in optimization toolbox objective?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello All,
I have an objective function of type: Gexp - phi*inv(lambda)*phi'
Out of this objective function Gexp is constant and known while rest of the term is to be found out at every iteration. So how to link that term to a function file which will give output as phi and lamda? And how to define the variable in the same function file so that the algorithm will determine the new value of phi and lamda after every iteration by changed value of variable it found during every iteration?
Thank You.
0 commentaires
Réponse acceptée
Torsten
le 8 Avr 2019
x = fmincon(@objective,x0,A,b)
function f = objective(x)
% Calculate phi and lambda from x
f = -phi*inv(lambda)*phi';
end
5 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Problem-Based Optimization Setup 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!