- #1
sayeh
- 2
- 0
Dear friends
I have a problem in creating a block tridiagonal matrix. I try to create a block tridiagonal matrix in MATLAB and I tried everything but it is not working for me. I have matrices A, B, C of dimension 4*4. Elements od these matrices are dependent on (n) and in each n has different values. I have to develop a block tridiagonal matrix D whose leading diagonal is matrix A and whose upper diagonal is matrix B and lower diagonal is Matrix C( as mentioned because these matrices are dependent on n , Elements of blocks in matrix (D) will change). I will be grateful if anyone can help me how to write it in MATLAB and especially as a part of M-file.
D=[A(n=1),B(n=1),0,0,0,0,0,0,0,0,0,0,0,0,...
C(n=2),A(n=2),B(n=2),0,0,0,0,0,0,0,0,...
0,0,0,0,C(n=3),A(n=3),B(n=3),0,0,0,0,...]
I have a problem in creating a block tridiagonal matrix. I try to create a block tridiagonal matrix in MATLAB and I tried everything but it is not working for me. I have matrices A, B, C of dimension 4*4. Elements od these matrices are dependent on (n) and in each n has different values. I have to develop a block tridiagonal matrix D whose leading diagonal is matrix A and whose upper diagonal is matrix B and lower diagonal is Matrix C( as mentioned because these matrices are dependent on n , Elements of blocks in matrix (D) will change). I will be grateful if anyone can help me how to write it in MATLAB and especially as a part of M-file.
D=[A(n=1),B(n=1),0,0,0,0,0,0,0,0,0,0,0,0,...
C(n=2),A(n=2),B(n=2),0,0,0,0,0,0,0,0,...
0,0,0,0,C(n=3),A(n=3),B(n=3),0,0,0,0,...]