Error with pinv in MATLAB r2018a

6 ビュー (過去 30 日間)
L'O.G.
L'O.G. 2022 年 5 月 4 日
コメント済み: Christine Tobler 2022 年 5 月 5 日
I am taking the pseudoinverse of a matrix using pinv but get the following error:
Error using svd
SVD did not converge.
Error in pinv (line 18)
[U,S,V] = svd(A,'econ');
I cannot reproduce this error in r2021b on my laptop. It only shows up when I run the code on a cluster in r2018a. Is this a known issue? Is there an easy way around it? I'm not sure about the specific matrix / data that causes the code to terminate (I'm analyzing a lot of data with this code on the cluster) but I could look into this if it might narrow down what's going on.

採用された回答

Steven Lord
Steven Lord 2022 年 5 月 4 日
Searching in the Bug Reports for "svd" in release R2018a found two that look potentially relevant.
Bug Report 1768487 is listed as fixed in release R2018a Update 3 and release R2018b.
Bug Report 2030137 is listed as fixed in releases R2019b, R2019a Update 5, and R2018b Update 5.
Are you using a particular Update of release R2018a? If so and if it's Update 1 or Update 2, or if you're using the general release R018a, try updating to Update 3.
  1 件のコメント
Christine Tobler
Christine Tobler 2022 年 5 月 5 日
Short addition: The "SVD did not converge" error started being given for some rare matrices in R2018a. This was fixed in R2018a Update 3 for real matrices, and later for complex matrices too (R2018b Update 5, R2019a Update 5, R2019b).
So if your matrices are always real, updating R2018a release should fix this. Otherwise, perhaps you can get a newer release than R2018a?
Unfortunately apart from that, the only thing to do there is to wrap the SVD call into a try/catch, and add some minor disturbance to the matrix and try again - this should get you out of the rare case where this error happens.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear Algebra についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by