I needed matlab code for cumulative sum of column vector

1 次查看(过去 30 天)
I needed matlab code for cumulative sum of column vector

回答(1 个)

Azzi Abdelmalek
Azzi Abdelmalek 2014-12-27
编辑:Azzi Abdelmalek 2014-12-27
yourarray=[1 2 3 4 5]
out=cumsum(yourarray)
  5 个评论
maha ismail
maha ismail 2014-12-27
it doesn't work as I need I need to produce I column vector also not a scalar because I need cumulative sum for more colmun vector such that each row element of new column vector coming from current and previous element row of vectors
Azzi Abdelmalek
Azzi Abdelmalek 2014-12-27
编辑:Azzi Abdelmalek 2014-12-27
Maybe you need this
yourarray=[1 2 3;4 5 6]
out=cumsum(yourarray,1)
%or
yourarray=[1 2 3;4 5 6]
out=cumsum(yourarray,2)

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by