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...