singular matrix inverse using svd in 2016 and 2013 version of a matlab
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
vani chaturvedi
il 16 Dic 2017
Risposto: Christine Tobler
il 18 Dic 2017
I am trying to solve the inverse of a singular matrix using svd in a matlab R2016a but is giving warning Warning: Matrix is singular to working precision.But while doing the same thing in matlab R2013a inverse is solvable with a warning : Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.252981e-18. Help it out...
2 Commenti
Matt J
il 16 Dic 2017
But what help could we give? You've posted no code that we can comment on, nor attached any .mat file that we can run the code with.
John D'Errico
il 16 Dic 2017
The difference is not relevant. In both cases, the inverse you will obtain is complete garbage.
If you show enough about what you are doing, it is possible that someone might be able to offer an alternative, or they might be able to explain why your matrix was generated incorrectly.
Risposta accettata
Walter Roberson
il 16 Dic 2017
The math library has been updated since R2013b, and the high performance math libraries have been updated (but it might have been R2016b that that happened). The results in the newer version are more likely to be mathematically justifiable—that is, the older releases were more likely to return results that were garbage and the newer versions are more likely to complain.
Sometimes it gets to be a pain in the current releases, especially when code is used that sure looks like it should create a positive definite matrix but due to multiple threads and round off error issues comes out slightly nonsymmetric.
0 Commenti
Più risposte (1)
Christine Tobler
il 18 Dic 2017
Take a look at the code of PINV ( edit pinv ), which is using the SVD to compute the pseudo-inverse of a matrix. x = pinv(A)*b computes the minimum-norm least-squares solution of A*x = b. Is this the operation you are doing?
In that case, I'd expect the warning is happening when you solve a linear system with the diagonal matrix D. You could either increase the tolerance so that the matrix is not singular anymore, or you could use implicit expansion:
x = D \ b;
x = diag(D) .\ b; % Equivalent but this is not a matrix operation, so will not check the condition and warn
0 Commenti
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!