hankel

Hankel matrix, constant along each anti-diagonal.

Category: Mathematics > Elementary Math

Syntax

H = hankel(c)

Square matrix with c as its first column and zeros below the anti-diagonal.

H = hankel(c, r)

Matrix with first column c and last row r, of size numel(c)-by-numel(r).

Description

In a Hankel matrix, H(i, j) is a function of i + j alone, so the anti-diagonals are constant. Such matrices arise when a sequence is arranged into overlapping windows, for instance in linear prediction, system identification and the moment problem.

A Toeplitz matrix is the same matrix with its columns reversed.

Input arguments

c
Vector giving the first column.
r
Vector giving the last row. If r(1) differs from c(end), the value of c(end) is used and a warning is issued.

Output arguments

H
The Hankel matrix: entry (i, j) depends only on i + j.

Example

One and two vectors

hankel([1 2 3])
hankel([1 2 3], [3 4 5])
Output
ans = 3×3

     1     2     3
     2     3     0
     3     0     0
ans = 3×3

     1     2     3
     2     3     4
     3     4     5

See also

toeplitz vander hilb gallery