How can I sum a matrix in a For Loop?
Afficher commentaires plus anciens
Hi;
I've a model done with matlab in wich I've several for loop, every step of every cycle creates a matrix. I want to sum every created matrix.
thanks
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 2 Nov 2012
eg
res=0
for k=1:5
M=rand(4);
res=bsxfun(@plus,res,M)
end
1 commentaire
Edoardo
le 2 Nov 2012
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!