MATLAB: Solving for an unkown matrix

matrix

Is there a way to solve the following matrix equation in matlab?
P*A + B*P = C
A,B,C,P have the same matrix dimensions. A,B,C are known matrices. P is an unknown matrix.

Best Answer

This is the Sylvester equation. You can solve it using the LYAP command.
A = rand(3);
B = rand(3);
C = rand(3);
P = lyap(B,A,-C)
P*A+B*P - C
Related Question