cumsum of a matrix
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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?
0 Kommentare
Antworten (2)
the cyclist
am 25 Mai 2012
Is this what you mean?
M = rand(5,6);
S = sum(cumsum(M),2);
1 Kommentar
Muhammad Furqan
am 25 Okt. 2017
Bearbeitet: Muhammad Furqan
am 25 Okt. 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);
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/186324/image.png)
S = sum(cumsum(M),2); 1.02263280043603 2.03657698954441
Siehe auch
Kategorien
Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!