extracting diagonals from 3d matrices
Afficher commentaires plus anciens
I try to extract diagonals from 7*7*217 matrices into 1*7*217. How can i make it? I tried below code but it did't work. I would appreciate if you help me.
for k=1:217
D(:,:,k)=diag(diag(L(:,:,k)));
end
Réponses (1)
Lr=reshape(L,1,49,[]);
D=Lr(1,1:8:end,:);
Catégories
En savoir plus sur Operating on Diagonal Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!