MATLAB: How to generate an array of Hankel and Toeplitz from a defined array

matricesmatrixmatrix arraymatrix manipulation

How to generate a matrix of H and a matrix of T, and my matrix to generate these other two has dimension 4×4
1 22 3 4
23 32 11 10
55 88 63 3
4 8 10 5
with the H matrix being
22 3 4
3 4 0
4 0 0
and the T matrix being
1 22 3
0 1 22
0 0 22
Thus, the matrices of H and T have this behavior described in the last two matrices. Thanks any help!

Best Answer

A =
1 22 3 4
23 32 11 10
55 88 63 3
4 8 10 5
>> H=hankel(A(1,2:4))
H =
22 3 4
3 4 0
4 0 0
>> T=triu(toeplitz(A(1,1:3)))
T =
1 22 3
0 1 22
0 0 1