How do I solve a constrained linear least squares problem where the constraint depends on elements in the solution?

3 ビュー (過去 30 日間)
I have simplified the problem for ease of exposition.
I am solving for x in A*x = b. If x = [x1,x2,x3,x4], I require that x3 = (x4 - x2)./2;
My starting point was the lsqlin function, but I am unsure about how to implement the constraint.
A = [ (1+.0129*.5) 0 0 0; 0 (1+.0164) 0 0; (.0132*.5) (.0132*.5) (.0132*.5) (1+.0132*.5) ];
b = [1;1;1];
Thanks

採用された回答

Torsten
Torsten 2016 年 12 月 7 日
A=[ (1+.0129*.5) 0 0 0; 0 (1+.0164) 0 0; (.0132*.5) (.0132*.5) (.0132*.5) (1+.0132*.5);0 1 2 -1 ];
b=[1;1;1;0];
sol=A\b
Best wishes
Torsten.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Least Squares についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by