Optimization Constraints

3 次查看(过去 30 天)
George
George 2011-11-15
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

采纳的回答

George
George 2011-11-16
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?

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by