1
votes

I have a complex equation involving matrices:

R = expm(X)*A + (expm(X)-I)*inv(X)*B*U; 

where R, B and U are known matrices.
I is an identity matrix.

I need to solve for X. Is there any way to solve this in MATLAB?

1
Is A supposed to be one of the known matrices? - user1543042
Yes. A is a known Matrix as well. - shilpa prakash

1 Answers

0
votes

If your equation is nonlinear and you have access to MATLAB optimization toolbox you can use the fsolve function (You can still use it for a linear equation, but it may not be the most efficient approach). You just need to reformat your equation into the form F(x) = 0, where x is a vector or a matrix. For example, if X is a vector of length 2:

Define your function to solve:

function F = YourComplexEquation(X)
Fmatrix = expm(X)*A + (expm(X)-I)*inv(X)*B*U - R
% This last line is because I think fsolve requires F to be a vector, not a matrix
F = Fmatrix(:);

Then call fsolve with an initial guess:

X = fsolve(@YourComplexEquation,[0;0]);