How can I sum a matrix in a For Loop?
Mostra commenti meno recenti
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
Risposta accettata
Più risposte (1)
Azzi Abdelmalek
il 2 Nov 2012
eg
res=0
for k=1:5
M=rand(4);
res=bsxfun(@plus,res,M)
end
1 Commento
Edoardo
il 2 Nov 2012
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!