Imposing additional constraints while using 'lsqnonneg'
Show older comments
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.
Answers (1)
Teja Muppirala
on 10 Jul 2012
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]
1 Comment
Sathish Akella
on 10 Jul 2012
Categories
Find more on Linear Least Squares in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!