Toeplitz Matrix

7 visualizaciones (últimos 30 días)
hunterilmenau Abdulkarim
hunterilmenau Abdulkarim el 13 de Mayo de 2011
Comentada: Sibo Van Gool el 8 de Oct. de 2021
Hallo all, I'm trying to create this matrix (Toeplitz Matrix):
1 0 0 0
2 1 0 0
3 2 1 0
0 3 2 1
0 0 3 2
0 0 0 3 how can I achieve that ?
thanks for help

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 13 de Mayo de 2011
T =tril(toeplitz([1 2 3 0 0 0 ],[1 2 3 0]))
  2 comentarios
hunterilmenau Abdulkarim
hunterilmenau Abdulkarim el 13 de Mayo de 2011
Hi
many thanks Sean , but what in case of a general vector . i.e, in this case h=[1 2 3] , what if I want to make it general for any given vector h ?
Sean de Wolski
Sean de Wolski el 13 de Mayo de 2011
Oleg's method is better because it doesn't require the call to tril:
v = 1:5;
T = toeplitz([v(:);zeros(numel(v),1)],zeros(numel(v)+1,1))

Iniciar sesión para comentar.

Más respuestas (2)

Oleg Komarov
Oleg Komarov el 13 de Mayo de 2011
toeplitz([1 2 3 0 0 0],[1 0 0 0])
  1 comentario
hunterilmenau Abdulkarim
hunterilmenau Abdulkarim el 13 de Mayo de 2011
Hi
many thanks Oleg , but what in case of a general vector . i.e, in this case h=[1 2 3] , what if I want to make it general for any given vector h ?

Iniciar sesión para comentar.


hunterilmenau Abdulkarim
hunterilmenau Abdulkarim el 13 de Mayo de 2011
Hi guys ,
thanks again , it worked , I just modified as follows:
t=toeplitz([h zeros(1,7)],[1 0 0 0 0 0 0 0])
where h is the original vector.
cheer u
  1 comentario
Sibo Van Gool
Sibo Van Gool el 8 de Oct. de 2021
For a more generalized version:
t = toeplitz([h zeros(1,length(h)-1)],[h(1) zeros(1, length(h)-1)])

Iniciar sesión para comentar.

Categorías

Más información sobre Linear Algebra en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by