MATLAB Solving Singular Matrix in MATLAB

  • Thread starter Thread starter ysun8@uic.edu
  • Start date Start date
  • Tags Tags
    Matrix
Click For Summary
When dealing with a singular matrix in MATLAB, obtaining its inverse directly is not possible. A common workaround is to add a small multiple of the identity matrix to the singular matrix, such as 0.00005 times the identity matrix. This technique, known as Tikhonov regularization or ridge regression, can help stabilize the inversion process. The modified equation w0 = (S + 0.00005*eye(size(S)))\meandiff can yield a solution, but it is essential to understand that this adjustment alters the original matrix, potentially affecting the results. It's also noted that encountering a singular matrix often indicates an issue in earlier calculations.
ysun8@uic.edu
Messages
1
Reaction score
0
singular matrix ?

Hi, guys,

< in MATLAB >
what should i do if i want to get the inverse matrix but it's a singular one? can i just add a very small identity matrix like 0.00005 on the diagnol? will it change the result?

eg:

w0 = S\meandiff

is that the same as

w0 = ( S+0.00005*eye( size( S ) ) )\meandiff


thanks!
 
Physics news on Phys.org
Usually if you get a singular matrix, you screwed up somewhere before the inverting step.

cookiemonster
 

Similar threads

Replies
8
Views
4K
Replies
2
Views
2K
  • · Replies 18 ·
Replies
18
Views
6K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K