How to make a big tridiagonal matrix with matrices?

5 views (last 30 days)
How can I make a matrix H from two smaller matrices as shown in the attached image?

Accepted Answer

David Hill
David Hill on 1 Sep 2020
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));

More Answers (0)

Categories

Find more on Resizing and Reshaping 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!