How can I sum a matrix in a For Loop?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (1)
Azzi Abdelmalek
el 2 de Nov. de 2012
eg
res=0
for k=1:5
M=rand(4);
res=bsxfun(@plus,res,M)
end
1 comentario
Edoardo
el 2 de Nov. de 2012
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!