将列表 list1转换成4*4的矩阵,并求其逆矩阵list1 =[2,7,9.10,12,4,6,90,7,35,44,37,8,10,12,14]
时间: 2023-10-05 09:13:13 浏览: 47
python 列表,数组,矩阵两两转换tolist()的实例
5星 · 资源好评率100%
import numpy as np
list1 = [2,7,9,10,12,4,6,90,7,35,44,37,8,10,12,14]
matrix1 = np.array(list1).reshape(4,4) # 将列表转换成4*4的矩阵
print(matrix1)
inverse_matrix1 = np.linalg.inv(matrix1) # 求矩阵的逆矩阵
print(inverse_matrix1)
阅读全文