I needed matlab code for cumulative sum of column vector

조회 수: 4 (최근 30일)
maha ismail
maha ismail 2014년 12월 27일
편집: Azzi Abdelmalek 2014년 12월 27일
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에서 Random Number Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by