MATLAB: Do I get an “out of memory” error when I take the inverse of a sparse matrix in MATLAB 6.5 (R13)

fullinverseMATLABmemoryofoutsparse

Why do I get an "out of memory" error when I take the inverse of a sparse matrix in MATLAB 6.5 (R13)?
I have created a sparse matrix. When I take the inverse of the matrix using the INV command I get the following error message:
??? Error using ==> inv
Out of memory. Type HELP MEMORY for your options.
I did not encounter this error when using MATLAB 6.1 (R12.1).

Best Answer

This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This is a bug in MATLAB 6.5 (R13). Our development staff is aware of the issue.
To work around this you can either convert the matrix to a full matrix using the FULL function before taking the inverse, or preferably, use the backslash function instead of explicitly computing the inverse. For more information about the backslash function and INV, please see the solution attached at the bottom of this page.