How to determine the matrix in the following case Say we have a vector $\textbf{b}$ and $\textbf u$ such that:
 $$A \mathbf b= \mathbf u$$
Where $A$ is a square matrix.
If $\mathbf b$ and $\mathbf u$ are known and $A$ is the unknown, How to get the matrix $A$  (perhaps it is not unique but how can one proceed to get it)?
 A: The locus of possible matrices $A$ is just the set of simultaneous solutions of the equations $$a_{i1}b_1+\ldots+a_{ik}b_k=u_i,$$ where $k$ is the dimension of the vector $b$, and $i$ runs over the coordinates of $u$ (that correspond to the rows of $A$). In other words, if $b\neq0$, the space of all such $A$ is a linear variety of dimension $nk-n$ (assuming $n\times k$ to be the size of $A$).
A: If ${\bf u},{\bf b}$ are $n$-dimensional column  vectors with ${\bf b}\not={\bf 0}$ (otherwise also ${\bf u}$ should be ${\bf 0}$), just take $$A=\frac{{\bf u}\cdot {\bf b}^t}{\|{\bf b}\|^2}$$
Then
$$A{\bf b}=\frac{({\bf u}\cdot {\bf b}^t) {\bf b}}{\|{\bf b}\|^2}=\frac{{\bf u}({\bf b}^t {\bf b})}{\|{\bf b}\|^2}={\bf u}.$$
For example by taking
$${\bf b}=\begin{pmatrix}1\\ 2\end{pmatrix}\quad\mbox{and}\quad {\bf u}=\begin{pmatrix}3\\ 4\end{pmatrix}$$
then $\|{\bf b}\|^2=5$ and 
$\displaystyle A=\begin{pmatrix}3/5 &6/5 \\4/5 &8/5\end{pmatrix}$.
A: $$\begin{pmatrix}a_{11} &a_{12} \\a_{21} &a_{22}\end{pmatrix}\begin{pmatrix}b_1\\ b_2\end{pmatrix}=\begin{pmatrix}u_1\\ u_2\end{pmatrix}$$
Is equivalent to
$$\begin{pmatrix}a_{11}b_1+a_{12}b_2 \\a_{21}b_1+a_{22}b_2 \end{pmatrix}=\begin{pmatrix}u_1\\ u_2\end{pmatrix}$$
or
$$\begin{pmatrix}b_1 &b_2 &0 &0\\0 &0 &b_1 &b_2 \end{pmatrix}\begin{pmatrix}a_{11}\\ a_{12}\\a_{21}\\a_{22} \end{pmatrix}=\begin{pmatrix}u_1\\ u_2\end{pmatrix}.$$
You can then solve for $A$ using row reduction of the appropriate augmented matrix. 
This can be easily generalized: Suppose $A$ is $m\times n$ and $b$ is $n\times 1$. Let $a^T$ be the $1\times mn$ vector formed by the concatenation of the rows of $A$, and $B$ be the $m\times mn$ matrix given by
$$B=\begin{pmatrix}b^T & 0 & \cdots & 0\\0 &b^T &\cdots &0\\\vdots&\vdots&\ddots &\vdots\\
0&0&\cdots & b^T\end{pmatrix} $$
where each $0$ represents a row vector of $n$ zeros. Then the system is
$$Ba=u.$$
