title: Matlab, operator A\B
body: <p>What is the result of the operation A\B, where A(1, m) and B (1, m)?</p>
  
  <p>In the manual it is written: </p>
  
  <pre><code>A\B returns a least-squares solution to the system of equations A*x= B.
  </code></pre>
  
  <p>So it means x = inv (A'*A)*A'*B? However, the matrix A'*A is singular...</p>
  
  <p>Let us suppose:</p>
  
  <pre><code>A=[1 2 3]
  B=[6 7 6]
  A\B
  
  0         0         0
  0         0         0
  2.0000    2.3333    2.0000
  </code></pre>
  
  <p>If ve use MLS:</p>
  
  <pre><code>C = inv (A'*A)   singular matrix
  C = pinv(A'*A)
  
  0.0051    0.0102    0.0153
  0.0102    0.0204    0.0306
  0.0153    0.0306    0.0459
  
  D= C*A'*B
  
  0.4286    0.5000    0.4286
  0.8571    1.0000    0.8571
  1.2857    1.5000    1.2857
  </code></pre>
  
  <p>So results A\B and inv (A'*A)*A'*B are different...</p>