Optimization Constraints

Hi
I want to find a solution of the following problem.
min 1/2 * x'*Q*x - f*x' s.t. sum(x) = 0 sum(abs(x)) = 1
I am using the function quadprog but i don't know how to give the second constraint the one with the absolute.
Is there a way to give such constraints in quadprog or fmincon or some other matlab optimization function??
Any help would be appreciated
Thanks George

 Respuesta aceptada

George
George el 16 de Nov. de 2011

0 votos

I think i can use the argument nonlcon in fmincon function.
function [cineq ceq] = nonlcon(x)
ceq sum(abs(x))-1;
cineq = [];
end
fmincon(@myfun,A,b,Aeq,beq,lb,ub,@nonlcon,options);
Anyone can confirm that?

Más respuestas (0)

Categorías

Más información sobre Quadratic Programming and Cone Programming en Centro de ayuda y File Exchange.

Preguntada:

el 15 de Nov. de 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by