# hankel

## 语法

``H = hankel(c)``
``H = hankel(c,r)``

## 说明

``H = hankel(c)` 返回正方形 汉克尔矩阵，其中 `c` 定义矩阵的第一列，主反对角线以下的元素为零。`

``H = hankel(c,r)` 返回汉克尔矩阵，第一列为 `c`，最后一行为 `r`。如果 `c` 的最后一个元素不同于 `r` 的第一个元素，则 `hankel` 会发出警告，并对反对角线使用 `c` 的最后一个元素。`

## 示例

```c = [1 2 3 4]; hankel(c)```
```ans = 4×4 1 2 3 4 2 3 4 0 3 4 0 0 4 0 0 0 ```

```c = [2 4 6]; r = [6 5 4 3 2 1]; hankel(c,r)```
```ans = 3×6 2 4 6 5 4 3 4 6 5 4 3 2 6 5 4 3 2 1 ```

```c = [1 2 3]; r = [4 5 7 9]; hankel(c,r)```
```Warning: Last element of input column does not match first element of input row. Column wins anti-diagonal conflict. ```
```ans = 3×4 1 2 3 5 2 3 5 7 3 5 7 9 ```

```c = [1+2i 2-4i -1+3i]; r = [-1+3i 3-1i 1-2i]; hankel(c,r)```
```ans = 3×3 complex 1.0000 + 2.0000i 2.0000 - 4.0000i -1.0000 + 3.0000i 2.0000 - 4.0000i -1.0000 + 3.0000i 3.0000 - 1.0000i -1.0000 + 3.0000i 3.0000 - 1.0000i 1.0000 - 2.0000i ```

## 详细信息

### 汉克尔矩阵

`$H=\left[\begin{array}{ccccccc}{c}_{1}& {c}_{2}& {c}_{3}& \cdots & \cdots & \cdots & \cdots \\ {c}_{2}& {c}_{3}& ⋰& ⋰& ⋰& ⋰& ⋮\\ {c}_{3}& ⋰& ⋰& ⋰& ⋰& ⋰& ⋮\\ ⋮& {c}_{m-1}& {c}_{m}& {r}_{2}& ⋰& ⋰& {r}_{n-2}\\ {c}_{m-1}& {c}_{m}& {r}_{2}& ⋰& ⋰& {r}_{n-2}& {r}_{n-1}\\ {c}_{m}& {r}_{2}& \cdots & \cdots & {r}_{n-2}& {r}_{n-1}& {r}_{n}\end{array}\right].$`