필터 지우기
필터 지우기

Optimization Constraints

조회 수: 4 (최근 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