MATLAB Answers

Block diagonal change the first and last blocks with some other matrices

1 view (last 30 days)
Mücahit Özalp
Mücahit Özalp on 16 Jun 2021
Edited: Mücahit Özalp on 19 Jun 2021
C([1 end])=C([1 end])+1;
B([1 end])=B([1 end])-1/2;
I have B and C matrices. I can form a blockdiagonal matrix such that C on the diagonal. As follows;
But I want to change the first and the last blocks with the matrix B.( In the first block and last block instead of C there should be B matrix.)
How can I do that? (N will be a variable so the size of the matrix will change according to the written N value.)

Answers (1)

David Hill
David Hill on 16 Jun 2021
Why not use blkdiag() function?

Community Treasure Hunt

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

Start Hunting!

Translated by