MATLAB: How to solve A*X + X*B = C equation for X? where A, B&C are 2*2 matrixes.

MATLABmatrix manipulationsolve

A = [1 1;2 3] B= [5 6;7 8] C = [11 12;13 14] Syms X; Eqn = A*X + X*B == C; solve(Eqn,X); % I'm facing difficulties to define matrix X as syms

Best Answer

If you're using release R2014a or later, use the sylvester function in MATLAB.
If you're using an older release but have access to Control System Toolbox, use the lyap function.
Related Question