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:

https://mathematica.stackexchange.com/questions/91651/nearest-kronecker-product

Also there is a matlab code:

https://gist.github.com/tholden/58dd9a8991daa750ae36a633fe7060a4/revisions

can you convert mathematica code to maple?

Please Wait...