How to make a big tridiagonal matrix with matrices?

How can I make a matrix H from two smaller matrices as shown in the attached image?

 채택된 답변

David Hill
David Hill 2020년 9월 1일
h=size(H0);
a=[H0,zeros(h);zeros(h),H0];
b=[zeros(h),H1;H1,zeros(h)];
H=blkdiag(a,a,a,a,a,a)+blkdiag(b,b,b,b,b,b)+blkdiag(zeros(h),b,b,b,b,b,zeros(h));

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

질문:

2020년 9월 1일

답변:

2020년 9월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by