Solving matrix equation A B = C. with B(n* 1) and C(n *1)
<p>I am trying to solve a matrix equation such as <code>A.B = C</code>. The A is the unknown matrix and i must find it. 
I have <code>B(n*1)</code> and <code>C(n*1)</code>, so <code>A</code> must be <code>n*n</code>. </p>

<p>I used the <code>BT* A.T =C.T</code> method (<code>numpy.linalg.solve(B.T, C.T)</code>).
But it produces an error:</p>

<blockquote>
  <p>LinAlgError: Last 2 dimensions of the array must be square.</p>
</blockquote>

<p>So the problem is that B isn't square.</p>

<p>If you're solving for the matrix, there is an infinite number of solutions (assuming that <code>B</code> is nonzero). Here's one of the possible solutions: </p>

<p>Choose an nonzero element of <code>B</code>, <code>Bi</code>. Now construct a matrix <code>A</code> such that the <code>i</code>th column is <code>C / Bi</code>, and the other columns are zero.</p>

<p>It should be easy to verify that multiplying this matrix by <code>B</code> gives <code>C</code>.</p>

python matrix equation-solving