Borrar filtros
Borrar filtros

matrix addition

7 visualizaciones (últimos 30 días)
Jim O'Doherty
Jim O'Doherty el 28 de Nov. de 2011
All, I've got a 3-d matrix, sum_total(:,:,i) "i" is in a loop, and can be anything from 20 to 100, therefore making the length unknown until after the loop is finished.
Does anyone know how I might add all the matrices of the variable together to make a single matrix? I tried "cumsum" with no luck.
Jim

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 28 de Nov. de 2011
A=rand(3,4,5);
B=sum(A,3); % sum at the third dimension.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by