I want to solve the folowing problem **B\*M=V**, where **B** is the unknown of size *3x3*, **M** of size *3xN* and **V** of size *3xN*. The difficulty is, that **B** has to be unitary. 


*N* is in the range of 500. All matrices are real.


Solving the problem by multiplying from right with the pseudoinverse of **M** gives a solution that is close to being unitary.


Does somebody have a hint how to solve it? Best would be a solution by aid of Matlab or a C++ library like Eigen.



matrix regression under side conditions
For this to work, the singular value decompositions of $V$ and $M$ can be written in the form
$$ V = U\_1 \Sigma U\_2^\*, \ M = U\_3 \Sigma U\_2^\*$$
with the same $\Sigma$ and $U\_2$, and you have $B = U\_1 U\_3^\*$. 


