How do I select elements out of a matrix with a loop?
Mostra commenti meno recenti
Hi, please help. I have a 16x16 matrix where I need to pick a 16 elements out for a 4x4 matrix. (Guyan reduction) I don't know how to make loops jet. /Klara
Risposte (1)
David Sanchez
il 25 Set 2013
You can try the following:
A = rand(16); % a 16x16 random matrix
B = reshape(M,4,4,16); % you will get 16 4x4 matrices. To access these matrices:
for k=1:16
B(:,:,k);
end
Categorie
Scopri di più su Dynamic System Models in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!