Toeplitz Matrix
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Sean de Wolski
2011-5-13
T =tril(toeplitz([1 2 3 0 0 0 ],[1 2 3 0]))
2 个评论
Sean de Wolski
2011-5-13
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))
更多回答(2 个)
hunterilmenau Abdulkarim
2011-5-13
1 个评论
Sibo Van Gool
2021-10-8
For a more generalized version:
t = toeplitz([h zeros(1,length(h)-1)],[h(1) zeros(1, length(h)-1)])
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!