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]
1 件のコメント
Sathish Akella
2012 年 7 月 10 日
カテゴリ
ヘルプ センター および File Exchange で Linear Least Squares についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!