Equation of the form $AX=B$ but in matrix form I have an equation of the following form:
$$BK=A$$
where $A\in\mathbb{R}^{n\times n}$, $B\in\mathbb{R}^{n\times l}$ and $K\in\mathbb{R}^{l\times n}$, with $l\leq n$. $B$ and $A$ are known, and I want to find some $K$ that satisfies the equation.
Due to the matrices $B$ and $K$ not being square (in general) the obvious problem is that $B$ cannot be inverted to solve the problem directly.
So, there are $n\times n$ equations and $n\times l$ unknowns. I'm trying to express this system in the usual, vector form:
$$\hat{B}k=a$$
with $\hat{B}$ being a square matrix, and $a$ and $k$ unidimensional vectors, to solve it as a common underdetermined linear system.
Is there a way to re-write the original equation in this way?
 A: After some thought I managed to get what I wanted. I'll use an example to make it easier to understand. Suppose that:
$$
  A=
  \left[ {\begin{array}{}
   a_1 & a_2 & a_3\\
   a_4 & a_5 & a_6\\
   a_7 & a_8 & a_9\\
  \end{array} } \right]
$$
$$
  K=
  \left[ {\begin{array}{}
   k_1 & k_2 & k_3\\
   k_4 & k_5 & k_6 \\
  \end{array} } \right]
$$
$$
  B=
  \left[ {\begin{array}{}
   b_1 & b_2 \\
   b_3 & b_4 \\
   b_5 & b_6 \\
  \end{array} } \right]
$$
Then:
$$BK=A\implies   
\left[ {\begin{array}{}
   b_1 & b_2 \\
   b_3 & b_4 \\
   b_5 & b_6 \\
  \end{array} } \right]
  \left[ {\begin{array}{}
   k_1 & k_2 & k_3\\
   k_4 & k_5 & k_6 \\
  \end{array} } \right]
=
  \left[ {\begin{array}{}
   a_1 & a_2 & a_3\\
   a_4 & a_5 & a_6\\
   a_7 & a_8 & a_9\\
  \end{array} } \right]
$$
It can be seen that this set of equations can be also expressed as:
$$   
\left[ {\begin{array}{}
   b_1 & b_2 & 0& 0& 0& 0\\
0& 0&b_1 & b_2 & 0& 0\\
0& 0 & 0& 0&b_1 & b_2\\
   b_3 & b_4 & 0& 0& 0& 0\\
0& 0&b_3 & b_4 & 0& 0\\
0& 0 & 0& 0&b_3 & b_4\\
   b_5 & b_6 & 0& 0& 0& 0\\
0& 0&b_5 & b_6 & 0& 0\\
0& 0 & 0& 0&b_5 & b_6\\
  \end{array} } \right]
  \left[ {\begin{array}{}
   k_1 \\ k_4 \\ k_2\\
   k_5 \\ k_3 \\ k_6 \\
  \end{array} } \right]
=
  \left[ {\begin{array}{}
   a_1 \\a_2\\ a_3\\
   a_4 \\ a_5 \\ a_6\\
   a_7 \\ a_8 \\ a_9\\
  \end{array} } \right]
$$
It's easy to take this to the general case where sizes are not $3$ and $2$ but $n$ and $l$.
