2

I have a sparse matrix in Matlab 43916x43916, which is calculated by this equation:

B=(speye(nV,nV)-alpha*NeMatrix+beta*NeMatrix*NeMatrix);

being nVa int, alphaa int, NeMatrix a sparse matrix and beta a int.

I can't do inv(B) because it increases the use of RAM till it crashes. I've tried LU already with no success.

How can I alternatively calculate this inverse matrix?

Amro
  • 123,847
  • 25
  • 243
  • 454
SamuelNLP
  • 4,038
  • 9
  • 59
  • 102

1 Answers1

2

The inverse will be a dense matrix. Thus you should check, whether you can handle a matrix of this size. Try, e.g., to set up ones(nV,nV) ... If you have enough storage, you may consider to compute the inverse column wise. The i-th column would be B\ei, where ei is the i-th unit vector.

HOWEVER, in numerical computations you hardly ever need the inverse of a matrix B. Most times B\v is enough, where v is a vector. So you better check, whether you really need the full inverse...

Jan
  • 4,932
  • 1
  • 26
  • 30