I was hoping somebody could tell me the best way to solve the following overdetermined system for the scalars $x_{1}$,$x_{2}$ and $x_{3}$, where the C $3 \times 1$ vectors are unknown, $A_{i}$ is a $3 \times 3$ matrix and $b_{i}$ is a $3 \times 1$ vector.
$ \left[ \begin{array}{cc} A_{1} \\ A_{2} \\ A_{3} \\ \end{array}\right] \left[ \begin{array}{cc} x_{1} \\ x_{2} \\ x_{3} \\ \end{array}\right]= \left[ \begin{array}{cc} C \\ C \\ C \\ \end{array}\right]- \left[ \begin{array}{cc} b_{1} \\ b_{2} \\ b_{3} \\ \end{array}\right] $
in a longer format this is written as
$ \left[ \begin{array}{ccccc} A_{1 \ 11} & \ldots &A_{1 \ 13} \\ \vdots & \ldots & \vdots \\ A_{1 \ 31} & \ldots &A_{1 \ 33} \\ A_{2 \ 11} & \ldots &A_{2 \ 13} \\ \vdots & \ldots & \vdots \\ A_{2 \ 31} & \ldots &A_{2 \ 33} \\ A_{3 \ 11} & \ldots &A_{3 \ 13} \\ \vdots & \ldots & \vdots \\ A_{3 \ 31} & \ldots &A_{3 \ 33} \\ \end{array}\right] \left[ \begin{array}{cc} x_{1} \\ x_{2} \\ x_{3} \\ \end{array}\right]= \left[ \begin{array}{cc} C_{1} \\ C_{2} \\ C_{3} \\ C_{1}\\ C_{2} \\ C_{3} \\ C_{1} \\ C_{2} \\ C_{3} \\ \end{array}\right]- \left[ \begin{array}{cc} b_{11} \\ b_{12} \\ b_{13} \\ b_{21} \\ b_{22} \\ b_{23} \\ b_{31} \\ b_{32} \\ b_{33} \\ \end{array}\right] $
I have attempted to solve the equation by eliminating the constants so I end up with an equation as follows:
$ \left[ \begin{array}{cc} A_{1} - A_{3}\\ A_{2}-A_{3} \\ \end{array}\right] \left[ \begin{array}{cc} x_{1} \\ x_{2} \\ x_{3} \\ \end{array}\right]= \left[ \begin{array}{cc} b_{3}- b_{1} \\ b_{3}- b_{2} \\ \end{array}\right] $
from which I find the least squares solution for $x_{1}$,$x_{2}$ and $x_{3}$. Can anybody tell me if this is the correct way to the solution which minimizes the error?
Kind regards