伪逆矩阵计算

2024-05-28 19:12:46 发布

您现在位置:Python中文网/ 问答频道 /正文

{a1}的逆矩阵的重复计算:

enter image description here

我用这个密码

from numpy import *
# https://classes.soe.ucsc.edu/cmps290c/Spring04/paps/lls.pdf
x = np.array([[-11, 2],[2, 3],[2, -1]]) 
print(x)
# computing the inverse using pinv
a = linalg.pinv(x)
print(a)

我的计算结果与讲座的结果不同。在

我的结果:

^{pr2}$

讲座结果:

[[-0.148  0.180  0.246]
 [ 0.164  0.189 -0.107]]

我做错什么了?请告诉我!在


Tags: fromhttpsimportnumpy密码ucsca1矩阵
1条回答
网友
1楼 · 发布于 2024-05-28 19:12:46

课堂讲稿有个错误。似乎他们发现了

    [-1   2]
A = [ 2   3]
    [ 2  -1]

(注意A[0,0]从-11改为-1。)下面是使用A版本的计算:

^{pr2}$

相关问题 更多 >

    热门问题