# Recovering matrix elements from a matrix equation

I have the following matrix equation: $$\overrightarrow{y}=H\overrightarrow{x}$$ where $H$ is a square matrix of $N$ elements, $y$ is a $N$ columns vector and $x$ a $N$ rows vector. Knowing $x$ and $y$ how can I find the matrix $H$ or, one of the matrices $H$ satisfying the previous equation?

Thanks

-

If by chance you are interested in the lowest rank of all such $H$, the rank one matrix $$H = \vec{y}\left(\frac{1}{\vec{x}^\top \vec{x}}\right)\vec{x}^\top$$ gives $$H\vec{x} = \vec{y}\left(\frac{1}{\vec{x}^\top \vec{x}}\right)\vec{x}^\top\vec{x} = \vec{y}\left(\frac{\vec{x}^\top\vec{x}}{\vec{x}^\top \vec{x}}\right) = \vec{y}$$

Additionally, you could find such $H$ nearest to any given matrix $A$ (use $A=0$ if you want to find the smallest possible $H$):

From QR on the vectors: $$x = Q_x e_1 |x|$$ $$y = Q_y e_1 |y|$$ Set $$S = \begin{bmatrix} \frac{|y|}{|x|} &\star &\star & \star&\cdots \\ 0&\star &\star & \star&\cdots \\ 0& \star&\star& \star &\cdots \\ \vdots &\vdots &\vdots & \vdots&\ddots \end{bmatrix}$$ where all $\star$ emements come from the respective elements of $$Q_y^* A Q_x$$ and use

$$H = Q_ySQ_x^*$$

This works because unitary matrices (as the QR factorization gives) are norm preserving: $$|A - \underbrace{Q_ySQ_x^*}_{H}| = |Q_y^*AQ_x - S|$$

-

There will be infinitely many matrices which satisfy your requirements given $x \neq 0$. To construct a matrix $H$ satisfying your requirements, suppose the $i^{th}$ component of $x$ is $x_i \neq 0$. Take the matrix with $\frac{y}{x_i}$ on the $i^{th}$ column and zeros everywhere else.

By the way, I think you mean that $x$ is a column vector too. You can't multiply an $n \times n$ matrix by a row vector on the right.

-
So you mean only one column is non-zero? That then would be the sparse version of my rank one answer, nice. Could also do the sparse full(er) rank version: diagonal with $\frac{y_i}{x_i}$, or $\infty \cdot y_i$ when $x_i=0$ (just kidding with infinity...) –  adam W Mar 26 '13 at 18:09