How to generate a symmetric Toeplitz matrix?

 Accepted Answer

Stephan
Stephan on 18 Jan 2020
Edited: Stephan on 18 Jan 2020
>> toeplitz([-pi 0 pi])
ans =
-3.1416 0 3.1416
0 -3.1416 0
3.1416 0 -3.1416
>> toeplitz([-pi -pi/2 0 pi/2 pi])
ans =
-3.1416 -1.5708 0 1.5708 3.1416
-1.5708 -3.1416 -1.5708 0 1.5708
0 -1.5708 -3.1416 -1.5708 0
1.5708 0 -1.5708 -3.1416 -1.5708
3.1416 1.5708 0 -1.5708 -3.1416

5 Comments

How can we make the size of the matrix 200 by 200?
I don't think you read the help for toeplitz. When called with one vector argument, toeplitz ALWAYS generates a symmetric toeplitz matrix, based on the vector provided.
So if you want a 200x200 matrix, then pass it a vector of length 200.
Use linspace:
vec = linspace(-pi,pi,200);
res = toeplitz(vec);
Thank you so much
Did you notice that you can accept and/or vote for useful answers?

Sign in to comment.

More Answers (0)

Categories

Tags

Asked:

on 18 Jan 2020

Edited:

on 26 Jan 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!