How to make a big tridiagonal matrix with matrices?

조회 수: 3 (최근 30일)
Udvas.C
Udvas.C 2020년 9월 1일
답변: David Hill 2020년 9월 1일
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개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by