Main Content

toeplitz

Symbolic Toeplitz matrix

Description

example

toeplitz(c,r) generates a nonsymmetric Toeplitz matrix having c as its first column and r as its first row. If the first elements of c and r are different, toeplitz issues a warning and uses the first element of the column.

example

toeplitz(r) generates a symmetric Toeplitz matrix if r is real. If r is complex, but its first element is real, then this syntax generates the Hermitian Toeplitz matrix formed from r. If the first element of r is not real, then the resulting matrix is Hermitian off the main diagonal, meaning that Tij = conjugate(Tji) for i ≠ j.

Examples

Generate Toeplitz Matrix

Generate the Toeplitz matrix from these vectors. Because these vectors are not symbolic objects, you get floating-point results.

c = [1 2 3 4 5 6];
r = [1 3/2 3 7/2 5];
toeplitz(c,r)
ans =
    1.0000    1.5000    3.0000    3.5000    5.0000
    2.0000    1.0000    1.5000    3.0000    3.5000
    3.0000    2.0000    1.0000    1.5000    3.0000
    4.0000    3.0000    2.0000    1.0000    1.5000
    5.0000    4.0000    3.0000    2.0000    1.0000
    6.0000    5.0000    4.0000    3.0000    2.0000

Now, convert these vectors to a symbolic object, and generate the Toeplitz matrix:

c = sym([1 2 3 4 5 6]);
r = sym([1 3/2 3 7/2 5]);
toeplitz(c,r)
ans =
[ 1, 3/2,   3, 7/2,   5]
[ 2,   1, 3/2,   3, 7/2]
[ 3,   2,   1, 3/2,   3]
[ 4,   3,   2,   1, 3/2]
[ 5,   4,   3,   2,   1]
[ 6,   5,   4,   3,   2]

Generate Toeplitz Matrix from Vector

Generate the Toeplitz matrix from this vector:

syms a b c d
T = toeplitz([a b c d])
T =
[       a,       b,       c,       d]
[ conj(b),       a,       b,       c]
[ conj(c), conj(b),       a,       b]
[ conj(d), conj(c), conj(b),       a]

If you specify that all elements are real, then the resulting Toeplitz matrix is symmetric:

syms a b c d real
T = toeplitz([a b c d])
T =
[ a, b, c, d]
[ b, a, b, c]
[ c, b, a, b]
[ d, c, b, a]

For further computations, clear the assumptions by recreating the variables using syms:

syms a b c d

Generate Toeplitz with Complex Values

Generate the Toeplitz matrix from a vector containing complex numbers:

T = toeplitz(sym([1, 2, i]))
T =
[  1, 2, 1i]
[  2, 1, 2]
[ -1i, 2, 1]

If the first element of the vector is real, then the resulting Toeplitz matrix is Hermitian:

isAlways(T == T')
ans =
  3×3 logical array
   1   1   1
   1   1   1
   1   1   1

If the first element is not real, then the resulting Toeplitz matrix is Hermitian off the main diagonal:

T = toeplitz(sym([i, 2, 1]))
T =
[ 1i, 2, 1]
[ 2, 1i, 2]
[ 1, 2, 1i]
isAlways(T == T')
ans =
  3×3 logical array
     0     1     1
     1     0     1
     1     1     0

Use Vectors with Conflicting First Element

Generate a Toeplitz matrix using these vectors to specify the first column and the first row. Because the first elements of these vectors are different, toeplitz issues a warning and uses the first element of the column:

syms a b c
toeplitz([a b c], [1 b/2 a/2])
Warning: First element of given column does not match first element of given row. 
Column wins diagonal conflict.
 
ans =
[ a, b/2, a/2]
[ b,   a, b/2]
[ c,   b,   a]

Input Arguments

collapse all

First column of Toeplitz matrix, specified as a vector or symbolic vector.

First row of Toeplitz matrix, specified as a vector or symbolic vector.

More About

collapse all

Toeplitz Matrix

A Toeplitz matrix is a matrix that has constant values along each descending diagonal from left to right. For example, matrix T is a symmetric Toeplitz matrix:

T=(t0t1t2tkt1t0t1t2t1t0t0t1t2t1t0t1tkt2t1t0)

Tips

  • Calling toeplitz for numeric arguments that are not symbolic objects invokes the MATLAB® toeplitz function.

Version History

Introduced in R2013a

See Also