extract matrix from for loop
Afficher commentaires plus anciens
Hi,
I want to extract a 2x2 matrix from each iteration of a for loop. Normally I would use something like
for loop=1:1:10
m=[a b c d];
m2(loop)=m;
end
but this doesn't work because of the increased dimensions. Can anyone help?
Réponse acceptée
Plus de réponses (1)
Sean de Wolski
le 16 Mai 2011
m2 = repmat(m,[1 10]);
or
m2 = repmat(m,[10 1]);
Catégories
En savoir plus sur MATLAB 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!