What is the result of the operation A\B, where A(1, m) and B (1, m)?
In the manual it is written:
A\B returns a least-squares solution to the system of equations A*x= B.
So it means x = inv (A'*A)*A'*B? However, the matrix A'*A is singular...
Let us suppose:
A=[1 2 3]
B=[6 7 6]
Then
A\B
0 0 0
0 0 0
2.0000 2.3333 2.0000
If ve use MLS:
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
So results A\B and inv (A'*A)*A'*B are different...
In the interesting cases I knew before answering this question -the ones which appear in real problems I'm aware of-, the matrix $A$ is just the opposite of the one you've chosen: it usually has (way far) more rows than columns (see overdetermined system) and those columns are linearly independent vectors. Let's call them $a_1, \dots , a_n$:
$$ A = (a_1 \dots a_n) \ . $$
Then $A^tA$ is the matrix of dot products
$$ A^tA = \begin{pmatrix} a_1\cdot a_1 & \dots & a_1\cdot a_n \\ \vdots & \vdots & \vdots \\ a_n\cdot a_1 & \dots & a_n\cdot a_n \end{pmatrix} $$
which is always non-singular.
EDIT. In your case, your matrix $A$ has three non-linearly independent columns. All of your systems $x +2y + 3z = 6, 7, 6$ have infinitely many solutions. Matlab choses one of them. For instance, for the first system $x + 2y + 3z = 6$, my Matlab gives me $(0,0,2)$ as a solution an explains to us
So, indeed, Matlab has given a solution with at most $K=1 = \mathrm{rank}(A)$ nonzero components per column. Otherwise said, if I'm not wrong, Matlab has solved the linear system $x + 2y + 3z = 6, x= 0, y = 0$.