[SciPy-dev] Matlab versus scipy

Nils Wagner nwagner at mecha.uni-stuttgart.de
Thu Oct 20 06:25:32 CDT 2005


Hi all,

Matlab offers a warning in case of nearly singular matrices

Matrix is close to singular or badly scaled
Results may be inaccurate

scipy doesn't have this feature. For what reason ?

Nils

from scipy import *
a = rand(3,3)
#a = 0.5*(a+transpose(a))
w = linalg.eigvals(a)
#
# Singular matrix
#
s = a-w[0]*identity(3)

dets=linalg.det(s)
svds=linalg.svdvals(s)
evals=linalg.eigvals(s)
print evals
print svds[0]/svds[-1]
invs=linalg.inv(s)
print invs





More information about the Scipy-dev mailing list