Imposing additional constraints while using 'lsqnonneg'
显示 更早的评论
Hi everyone,
I would like to impose additional constraints while using 'lsqnonneg'. Besides the non-negativity of the solution, I want to constrain the solution to be zero at the end points. I appreciate your effort towards the community.
thanks sathish.
回答(1 个)
Teja Muppirala
2012-7-10
I think this should work.
If you are minimizing |Cx - d|
First, remove the first and last columns of C, and call LSQNONNEG on that:
X = lsqnonneg(C(:,[2:end-1]),d)
Then add a zero to the beginning and end:
X = [0; X ; 0]
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!