# Thread: equation system on the diagonals of matrix product

1. ## equation system on the diagonals of matrix product

I'm looking for the set of m*n matrices W that simultaneously solve:
diag(AW)=b and diag(WA)=c for a given n*m matrix A and vectors b and c. With diag() I mean the vector of diagonal elements.
I'm happy even for just a starting point, or a single solution.

2. ## Re: equation system on the diagonals of matrix product

Unless m = n = 2, your dealing with an under-determined system aren't you ?
The first equation diag(AW) = b gets you n linear equations and the second, diag(WA) = c, m linear equations in the elements of W.
That means m + n equations for the mn unknown elements of W.
If that's the case ? there will be mn - m - n free variables.
Decide where, in W, you want these to be and solve for the others in terms of them.

3. ## Re: equation system on the diagonals of matrix product

Thanks for that. I was first thinking to somehow capture the full space of solutions. But on second thought I can come of with some reasonable set of constraints to narrow down the problem, hopefully to a single solution.