1.源码实现
import numpy as np;
from scipy.linalg import toeplitz;
k = np.arange(2, 6)
r = np.arange(2, 9, 2)
s = toeplitz(k, r)
t = toeplitz(k)
print(s)
print(t)
2.运行及其结果
$ python3 toeplitz.py
[[2 4 6 8]
[3 2 4 6]
[4 3 2 4]
[5 4 3 2]]
[[2 3 4 5]
[3 2 3 4]
[4 3 2 3]
[5 4 3 2]]
网友评论