How to generate a symmetric Toeplitz matrix?

 Respuesta aceptada

Stephan
Stephan el 18 de En. de 2020
Editada: Stephan el 18 de En. de 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 comentarios

Omar B.
Omar B. el 18 de En. de 2020
How can we make the size of the matrix 200 by 200?
John D'Errico
John D'Errico el 18 de En. de 2020
Editada: John D'Errico el 18 de En. de 2020
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);
Omar B.
Omar B. el 19 de En. de 2020
Thank you so much
Stephan
Stephan el 19 de En. de 2020
Did you notice that you can accept and/or vote for useful answers?

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Preguntada:

el 18 de En. de 2020

Editada:

el 26 de En. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by