Info
This question is closed. Reopen it to edit or answer.
How to specify enties of a block diagonal matrix
1 view (last 30 days)
Show older comments
c = input('c ');
g = input('g ');
M = cell(c+1,1);
a_t = min([1:c+1;repmat(c-g,1,c+1)]);
for i = 1:c+1
MCell = repmat({sym([char(i-1+'A') '%d%d'], [c+2-i c+2-i])}, 1, a_t(i));
M{i} = blkdiag(MCell{:});
end
B=blkdiag(M{:});
I am trying to make diagona matrix such that the block matrices from 1 to (c-g) are zero matrix and block matrix from (c-g+1) to c are only diagonal matrix with only first entry which is 'a'. Can someone please help me here?
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!