How do I solve a constrained linear least squares problem where the constraint depends on elements in the solution?
3 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
Torsten
on 7 Dec 2016
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.
More Answers (0)
See Also
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!