creating a repeating diagonal matrix
Show older comments
I'm trying to create a diagonal matrix with the following sequence on the main diagonal line where v is the vector v=[4,1,0,1] to get the following matrix
[4 0 0 0 0 0 0
0 1 0 0 0 0 0
0 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 4 0 ...]
but I want it to repeat the same sequence over an over again for a 100 by 100 matrix how would I be able to do this?
1 Comment
Muhammad Fiaz
on 24 Jan 2022
Can you do it?
Please I also need help..
Accepted Answer
More Answers (0)
Categories
Find more on Operating on Diagonal Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!