How do I solve a constrained linear least squares problem where the constraint depends on elements in the solution?
    3 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
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 commentaires
Réponse acceptée
  Torsten
      
      
 le 7 Déc 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.
Plus de réponses (0)
Voir également
Catégories
				En savoir plus sur Linear Least Squares dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

