H = hankel(c,r)
returns a Hankel matrix with c as its first column and
r as its last row. If the last element of c differs
from the first element of r, then hankel issues a
warning and uses the last element of c for the anti-diagonal.
Create a nonsymmetric Hankel matrix with specified column and row vectors.
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
Create another nonsymmetric Hankel matrix. If the last element of the column vector does not match the first element of the row vector, hankel issues a warning and uses the last element of the column for the anti-diagonal element.
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.
First column of Hankel matrix, specified as a scalar or a vector.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 Complex Number Support: Yes
r — Last row of Hankel matrix scalar | vector
Last row of Hankel matrix, specified as a scalar or a vector. If the last element
of c differs from the first element of r, then
hankel uses the last element of c for the
anti-diagonal.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 Complex Number Support: Yes
A Hankel matrix is a matrix in which the elements along each
anti-diagonal are equal:
If c is the first column of the Hankel matrix and
r is the last row of the Hankel matrix, then p = [c
r(2:end)] completely determines all elements of the Hankel matrix using the
mapping
Hi,j = pi+j-1.
All square Hankel matrices are symmetric.
Extended Capabilities
C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™.
GPU Arrays Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Distributed Arrays Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.