Hi, I want to know how to sum all the matrices in a loop at the end of it
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Saad Syed Iqbal Ahmed
el 5 de Feb. de 2016
I have a loop in which I define a matrix in each iteration. At the end of it I want to sum all of these matrices. Any help would be appreciated.
2 comentarios
Respuesta aceptada
Jan
el 5 de Feb. de 2016
Data = zeros(5, 6, 7);
for k = 1:5
Data(k, :, :) = rand(6, 7);
end
Result = sum(Data, 1);
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!