creating a repeating diagonal matrix
이전 댓글 표시
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
Muhammad Fiaz
2022년 1월 24일
Can you do it?
Please I also need help..
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
