Question: Nearest Kronecker Product

If A is an m × n matrix and B is a p × q matrix, then the Kronecker product C = A ⊗ B is the mp × nq block matrix. Assume I have matrix C and want to find matrix A and B. This problem has known solution called "Nearest Kronecker Product". So I just need a function like this: A,B:=NearestKroneckerProduct(C)  which minimizes ||C - A ⊗ B||F  where denotes frobenius norm. 

Here is an Image that shows a mathematica code:

I took it from the link below:

Also there is a matlab code:

can you convert mathematica code to maple?

Please Wait...