I want to use this code, where i have an N*N blocktridiagonal matrix, each entry is a an N*N tridiagonal matrix in itself. Could you please help me with how to enter the number of blocks.
syntax , nblk=rows/N;
N can be 100
please help me, how to use number of blocks in the algorithm.
Hello, John,
I did it in other way. I defined Amdb (A main diag. boundary blocks) in your code and then applied this:
s=repmat(Amdb(:),1,1);
v=[s;repmat(Amd(:),n-2,1);s];
It works and now I will try to go further with the solution of the examined problem. Thank you and regards!
Thank you for the quick and complete answer. Unfortunately, I'm not familiar with a "repmat" and how to replicate only the middle blocks and replace the first and the last one.
I tried this:
v = repmat(AmdF(1),n,1);
v = repmat(Amd(:),n,1);
v = repmat(AmdL(n),n,1);
but of course it doesn't work....
Have you got a clue how to call it?
Thank you in advance and appreciation again for the code!!!
Of course it is possible, since you can supply the individual blocks along the main diagonal. Since the diagonal blocks can be supplied as a pxqxn array in Amd, use repmat to replicate the middle blocks, then replace the first and last blocks in Amd as you wish. Then its just a call to blktridiag.
Hello,
can please help me to find out if it's possible, using "blktridiag", to generate a block tridiagonal matrix A, whose main diagonal (Amd) to starts and ends with different copies of Amd. I.e. AmdFirst and AmdLast~= Amd...
example:
[AmdF Asup 0 0 0;
Asub Amd Asup 0 0;
0 Asub Amd Asup 0;
0 0 Asub Amd Asup;
0 0 0 Asub AmdL]
I hope that the explanation was clear enought! Thank you in advance!
Regards
Comment only