當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


Python SciPy linalg.hankel用法及代碼示例

本文簡要介紹 python 語言中 scipy.linalg.hankel 的用法。

用法:

scipy.linalg.hankel(c, r=None)#

構造漢克爾矩陣。

Hankel 矩陣有恒定的反對角線,c 為第一列,r 為最後一行。如果未給出 r,則假定 r = zeros_like(c)。

參數

c array_like

矩陣的第一列。無論 c 的實際形狀如何,它將被轉換為一維數組。

r 數組,可選

矩陣的最後一行。如果沒有,r = zeros_like(c)假設。 r[0] 被忽略;返回矩陣的最後一行是[c[-1], r[1:]]。無論實際形狀如何r,它將被轉換為一維數組。

返回

A (len(c), len(r)) ndarray

漢克爾矩陣。 Dtype 與 (c[0] + r[0]).dtype 相同。

例子

>>> from scipy.linalg import hankel
>>> hankel([1, 17, 99])
array([[ 1, 17, 99],
       [17, 99,  0],
       [99,  0,  0]])
>>> hankel([1,2,3,4], [4,7,7,8,9])
array([[1, 2, 3, 4, 7],
       [2, 3, 4, 7, 7],
       [3, 4, 7, 7, 8],
       [4, 7, 7, 8, 9]])

相關用法


注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.linalg.hankel。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。