fmincon function handle using matrix
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Maite Alonso Parra
am 22 Aug. 2018
Beantwortet: Torsten
am 22 Aug. 2018
Hi I'm trying to solve a portfolio optimization problem using fmincon. I want to specify de Function to minimize with a function handle in witch X is a vector and L an m*m matrix.
function y = myfun(X,L) y = X'*L*X; end
How could I do? I don't use quadprog because I want to use nonlinear constrictions.
0 Kommentare
Akzeptierte Antwort
Torsten
am 22 Aug. 2018
myfun = @(x,L)x.'*L*x;
objfun = @(x)myfun(x,L);
sol = fmincon(objfun,...)
with x being an (mx1) column vector.
Best wishes
Torsten.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Nonlinear Optimization finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!