Solve for a matrix in a generic matrix equation?
1 view (last 30 days)
Show older comments
Eric Zhang
on 28 Jul 2016
Answered: Walter Roberson
on 28 Jul 2016
My past experience with MATLAB was solving for a matrix that has a simple solution (can be solved "as a whole"). For example, solving for X in AX=B is simply X=A\B assuming A is invertible.
What about solving for X in a complicated (or more generic) equation, where there is no simple solution like the one above? For example, \sum_{i=1}^{N} A_i*X'*X*A_i = B (just an illustrative example made up on the fly -- hopefully, there is no simple solution).
In this case, we need to spell out all the entries of X and form many equations to solve for each entry of X. Is there a clean way in MATLAB of doing this?
0 Comments
Accepted Answer
Walter Roberson
on 28 Jul 2016
In earlier versions of MATLAB you did have to construct separate equations and have them as distinct arguments to solve(). However, the last few releases it has been possible to create matrices of equations, which can make things a bit easier.
You do, however, still need to construct all of the entries. The engine underlying the symbolic toolbox does not have support for generic matrices of undefined size. You cannot, for example, say "A and B are matrices and x is a vector, now show me the general form of the solution to A*x == B". You cannot get out a general form like "inv(A)*B" as a solution. That is possible with some other symbolic packages but not with MATLAB's symbolic engine.
0 Comments
More Answers (0)
See Also
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!