美文网首页
scipy生成托普利兹矩阵

scipy生成托普利兹矩阵

作者: 一路向后 | 来源:发表于2021-05-24 21:25 被阅读0次

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]]

相关文章

网友评论

      本文标题:scipy生成托普利兹矩阵

      本文链接:https://www.haomeiwen.com/subject/jadfsltx.html