给定 N 的 toeplitz 矩阵
toeplitz Matrix for a given N
对于给定的 N,我需要创建以下矩阵:
我明白了:
from scipy.linalg import toeplitz
y=toeplitz(range(1,N))
将创建托普利茨矩阵。但它不是上面给出的精确矩阵。
感谢您的帮助
来自docs:
scipy.linalg.toeplitz(c, r=None)
Construct a Toeplitz matrix.
The Toeplitz matrix has constant diagonals, with c as its first column and r as its first row. If r is not given, r == conjugate(c) is assumed.
因此您需要像这样传递第一列和第一行:
toeplitz(c=[1, *np.arange(N,1,-1)], r=np.arange(1,N+1))
对于给定的 N,我需要创建以下矩阵:
我明白了:
from scipy.linalg import toeplitz
y=toeplitz(range(1,N))
将创建托普利茨矩阵。但它不是上面给出的精确矩阵。
感谢您的帮助
来自docs:
scipy.linalg.toeplitz(c, r=None)
Construct a Toeplitz matrix.
The Toeplitz matrix has constant diagonals, with c as its first column and r as its first row. If r is not given, r == conjugate(c) is assumed.
因此您需要像这样传递第一列和第一行:
toeplitz(c=[1, *np.arange(N,1,-1)], r=np.arange(1,N+1))