Matrices in a matrix
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
UGO mela
le 15 Mai 2017
Modifié(e) : Stephen23
le 15 Mai 2017
I have this matrix in which there are 9 different matrices each one is composed by 6 * 6 elements
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164111/image.png)
I want pre and post multiply each matrix-elements in this way:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/164113/image.png)
A is a matrix with the same size of R
P.S. : I have store R and A as a sparse matrices
How can I do?
Thanks
0 commentaires
Réponse acceptée
David Goodmanson
le 15 Mai 2017
Modifié(e) : David Goodmanson
le 15 Mai 2017
Hi UGO, should your top row read R11, R12, R13? at any rate, try
z = zeros(size(A));
C = [A z z;z A z;z z A];
B = C.'*R*C
where C is a block diagonal matrix.
1 commentaire
Plus de réponses (1)
John
le 15 Mai 2017
try
% if A is 6x6
A = rand(6);
A = repmat(A,3);
% if R is 18x18, constructed from multiple 6x6 sub Rij matrices
B = A'*R*A
0 commentaires
Voir également
Catégories
En savoir plus sur Operating on Diagonal Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!