Can't get "collect" to extract the determinant of the inverse of a symbolic matrix.
1 view (last 30 days)
Show older comments
I often invert complex symbolic matrices and end up with an impossibly complex result because matlab divides each term in the inverse by the determinant of the matrix. I'd like to extract the determinant as a common factor, but collect doesn't seem to work. For example, consider
syms a b c d
myMatrix = [a,b;c,d];
myInv = inv(myMatrix);
simple(myInv)
This returns
[ d/(a*d - b*c), -b/(a*d - b*c)]
[ -c/(a*d - b*c), a/(a*d - b*c)]
None of the commands invoked by "simple" do anything to the matrix. I'd like to find something that would return:
[ d,-b;-c,a]/(a*d-b*c)
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Assumptions 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!