How to use a matrix of 12*12 to form a matrix of 96*96?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
If B is a 12*12 matrix, and I want to place this B matrix as diagonal matrix of 96*96, How to form this 96*96 diagonal matrix?
4 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Paul
am 22 Sep. 2021
It's too bad we can't do something like this:
B = [1 2;3 4]; repeats = 2; % use a smaller example
% R = blkdiag(repmat({B},1,repeats){:}) % throws error
and instead have to do this
R = blkdiag(struct('temp',repmat({B},1,repeats)).temp)
1 Kommentar
Stephen23
am 22 Sep. 2021
Simpler:
B = {[1,2;3,4]};
R = 2; % use a smaller example
M = blkdiag(B{ones(1,R)})
Siehe auch
Kategorien
Mehr zu Operating on Diagonal Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!