Solving overdeterminated linear equation system with specified conditions
조회 수: 3 (최근 30일)
이전 댓글 표시
Dear fellows! I´m new in the world of matlab and i´d like to solve the following overdeterminated system of linear equations with lsqr-method.
A*p=b
where A is a (5x3) matrix, p=[p1;p2;p3] and b is vector with 5 given vector elements.
without any conditions i could solve the system with p=A\b or p=lsqr(A,b).
BUT following conditions have to be achivied for solving the problem
1. p1;p2;p3 are always >=0
2. p1+p2+p3=sum(p)=1
Does sombody can help me to set the conditions for the solving process?
best regards Thomas
댓글 수: 0
채택된 답변
Seth DeLand
2012년 3월 12일
Hi Thomas, If you have the Optimization Toolbox, LSQLIN can solve constrained least-squares problems: http://www.mathworks.com/help/toolbox/optim/ug/lsqlin.html
You can use the A and b arguments to enforce that p1; p2; p3 >= 0 and the Aeq and beq arguments to enforce that p1+p2+p3 = 1.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Systems of Nonlinear Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!