title: Quadratic programming with linear equality constraints in Matlab
body: <p>I have to identify an ARX under some linear constraints, this means that I have a quadratic programming with linear equality constraints problem.</p>
  
  <hr>
  
  <p>One way  is to use the following equations in the red boxes. A possible disadvantage  in this case is the calculation of the matrix inversions (sometimes Matlab gives me the warning:  Matrix is close to singular or badly scaled) </p>
  
  <p><img src="https://i.stack.imgur.com/7MU6U.jpg" alt="enter image description here"></p>
  
  <hr>
  
  <p>Another way is to use in Matlab the command:   quadprog()</p>
  
  <hr>
  
  <p>Another way is to use in Matlab the command:   lsqlin()</p>
  
  <hr>
  
  <p>Which of these three methods is the best one? </p>
  
  <p>Which is the most robust numerically?</p>