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>Here's a little example for you:</p>

<pre><code>import numpy as np

a = np.array([[1, 2], [3, 4]])
b = np.array([5, 6])
x = np.linalg.solve(a, b)

print "A={0}".format(a)
print "B={0}".format(b)
print "x={0}".format(x)
</code></pre>

<p>For more information, please read the <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.linalg.solve.html#numpy.linalg.solve" rel="nofollow">docs</a></p>

python matrix equation-solving