Filter löschen
Filter löschen

How to inverse a matrix efficiently?

41 Ansichten (letzte 30 Tage)
Tyler
Tyler am 27 Sep. 2014
Kommentiert: Image Analyst am 28 Sep. 2014
Hi All,
I have a 6x6 matrix with many symbolic variables inside.
I am looking to invert this matrix.
The matrix i have is the "stiffness matrix" in solid mechanics, and i'm looking to get the "compliance matrix" which is just the inverse.
I am not solving a linear set of equations, so the A\b trick doesnt work for me.
Is there a way to mimic the steps of the A\b inverse on a single matrix? I suspect no otherwise the command would already exist, but i may as well ask.
Any help would be greatly appreciated
Thanks!

Akzeptierte Antwort

Mohammad Abouali
Mohammad Abouali am 28 Sep. 2014
Bearbeitet: Mohammad Abouali am 28 Sep. 2014
if you are not looking for symbolic solution to the matrix inversion, but you have the numerical values of the entries in the 6x6 matrix and you want to know the numerical values for the inverse of that try this:
Ainv= A\eye(6);
or
Ainv=inv(A);
This would give you the inverse of A numerically.
Try this code, it would give you the inverse of a 6x6 mtrix symbolically. (hence you need symbolic toolbox of MATLAB) (and don't try this on big matrices):
for i=1:6
for j=1:6
eval(['syms a' num2str(i) num2str(j) ' real']);
eval(['A(' num2str(i) ',' num2str(j) ')= a' num2str(i) num2str(j) ';']);
end
end
Ainv=inv(A)
The inverse would be an ugly looking matrix with lots of terms in it. Try to use simplify or something on terms to make it easier to read. Or sometimes I paste it in a text editor and manually simplify it myself. for example I go and using find and replace that exists in every editor I say for example replace every a11*a22-a12*a21 by T1 and so on.

Weitere Antworten (1)

Image Analyst
Image Analyst am 28 Sep. 2014
Bearbeitet: Image Analyst am 28 Sep. 2014
Have you tried the inv() function to compute the inverse of a matrix?

Kategorien

Mehr zu Formula Manipulation and Simplification finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by