#矩阵Matrix (np.linalg函数)
import numpy as np
nd14 = np.arange(9).reshape([3, 3])
print(np.transpose(nd14))#转置
a = np.arange(12).reshape([3, 4])
b = np.arange(8).reshape([4, 2])
print('============')
print(a)
print('============')
print(b)
print('============')
print(a.dot(b))#矩阵乘法
print('============')
print(a.trace())#求迹
print('============')
print(np.linalg.det(nd14))#求行列式
print('============')
c = np.random.random([3, 3])
print(np.linalg.solve(c, np.eye(3)))#求逆
矩阵Matrix
最新推荐文章于 2023-07-15 21:30:23 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)