Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

vector=
3
4
8
5
2
1
6

the matrix i want to create is
3 0 0
4 3 0
8 4 3
5 8 4
2 5 8
1 2 5
6 1 2
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
183 views
Welcome To Ask or Share your Answers For Others

1 Answer

This was already covered in one of your previous questions. Although you aren't trying to create a square matrix in this example, you can still use the TOEPLITZ function like in Jonas' answer:

M = toeplitz(vector,[vector(1) 0 0]);

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...