【发布时间】:2022-07-01 23:19:55
【问题描述】:
如何使用双嵌套循环创建由三个特征向量列组成的矩阵 P。
from sympy.matrices import Matrix, zeros
from sympy import pprint
A = Matrix([[6,2,6], [2,6,6], [6,6,2]])
ew_A = A.eigenvals()
ev_A = A.eigenvects()
pprint(ew_A)
pprint(ev_A)
# Matrix P
(n,m) = A.shape
P = TODO # Initialising
# "filling Matrix P with ...
for i in TODO:
for j in TODO:
P[:,i+j] = TODO
## Calculating Diagonalmatrix
D= P**-1*P*A
非常感谢提前
【问题讨论】:
-
请修改您的帖子,使其不包含images of code。 (改为文本格式的邮政编码。)
标签: python math matrix diagonal