필터 지우기
필터 지우기

Error with pinv in MATLAB r2018a

조회 수: 2 (최근 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 CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by