In trying to write an integral relation in a discrete manner, I got to an equation of the form
$$MAM x=b$$
where $A$ is a given symmetric matrix, $b$ and $x$ are given vectors and unknown $M$ is a diagonal matrix. The values of all the matrices and vectors can be complex. How can I solve this for $M$?
My attempts
I tried to find patterns that would allow for inverting the order in which the matrices are applied but without a solution. Another thing I tried has been to actually write down explicitly the relation in order to get the system of equations. For the first equation, I got something like
$$m_{11} \left( a_{11}m_{11}x_1 + a_{12}m_{22}x_2 + \cdots + a_{1j}m_{jj}x_j + \cdots + a_{1n}m_{nn} x_n \right) = b_1$$
where $m_{ii}$ are the diagonal entries of $M$, $a_{ij}$ are entries of $A$ and so on for vectors $x$ and $b$, and so on for the other equations. This system of equations is not linear and I have no idea how to solve a non-linear system of equations.
I assume that another way in which the problem can be formulated, although it is not really the same is how can one solve a system of equations like
$$Ax = b/x$$
where $b/x$ should be interpreted as a vector defined by the element-wise division of each pair of points $(b/x)_j = b_j/x_j$.