cumsum of a matrix

1 visualización (últimos 30 días)
Mate 2u
Mate 2u el 25 de Mayo de 2012
Editada: Muhammad Furqan el 25 de Oct. de 2017
Hi there I have a nxm matrix. I want to do the cumsum of each column, then all of them added up to give one total cumsum.
Any help?

Respuestas (2)

Wayne King
Wayne King el 25 de Mayo de 2012
X = 1:100;
X = reshape(X,10,10);
X1 = cumsum(X(:));

the cyclist
the cyclist el 25 de Mayo de 2012
Is this what you mean?
M = rand(5,6);
S = sum(cumsum(M),2);
  1 comentario
Muhammad Furqan
Muhammad Furqan el 25 de Oct. de 2017
Editada: Muhammad Furqan el 25 de Oct. de 2017
M = rand(5,6); Mean that it creates random numbers of a matrix with 5 column and 6 rows. S = sum(cumsum(M),2); It generate commulative sum of the rows in one column. For example M = rand(2,3);
S = sum(cumsum(M),2); 1.02263280043603 2.03657698954441

Iniciar sesión para comentar.

Categorías

Más información sobre Fourier Analysis and Filtering 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