矩阵运算
矩阵是数的排列
1import numpy as np
2
3matrix = np.array([[6,4,24],[1,-9,8]])
4print(matrix)
矩阵加
两个矩阵相加,就是把对称位置的数相加:
1import numpy as np
2
3A_matrix = np.array([[3,8],[4,6]])
4B_matrix = np.array([[4,0],[1,-9]])
5c = A_matrix+B_matrix
6print(c)
python矩阵减
两个矩阵相减,就是把对称位置的数相减: