How can I sum a matrix in a For Loop?
Ältere Kommentare anzeigen
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
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 2 Nov. 2012
eg
res=0
for k=1:5
M=rand(4);
res=bsxfun(@plus,res,M)
end
1 Kommentar
Edoardo
am 2 Nov. 2012
Kategorien
Mehr zu MATLAB finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!