How can I get inverse matrix at 50 x 50 sparse matrix?
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I have a square sparse matrix A (50 x 50), and I need to get the inverse matrix of A.
for example, at A x B = C, I know A and C so I have to know matrix B. So I have to get A's inverse matrix.
But if I use inv(A) at the code, every matrix element of inv(A) get 'inf'.
How could I get this inverse matrix? Do I have other method to get matrix B?
1 comentario
Bruno Luong
el 18 de Oct. de 2024
Typically this happens when you try to solve on non invertible matrix. Small example
A=[1 2; 1 2]
inv(A)
B=rand(2);
C=A*B
B = A\C
Respuestas (1)
Walter Roberson
el 18 de Oct. de 2024
If inv(A) is all inf then chances are that A is singular. You should check rank(A) before proceeding.
You should probably not be forming inv(A) explicitly. You should probably be using
B = A\C;
The \ operator will find a solution that minimizes the sum of squares
Note that the inverse of a sparse matrix is typically a dense matrix. But that isn't going to matter if you use the \ operator.
3 comentarios
Angelo Yeo
el 18 de Oct. de 2024
@Esther Kang, can you give us a sample data to reproduce the issue?
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!