I needed matlab code for cumulative sum of column vector

1 Ansicht (letzte 30 Tage)
maha ismail
maha ismail am 27 Dez. 2014
Bearbeitet: Azzi Abdelmalek am 27 Dez. 2014
I needed matlab code for cumulative sum of column vector

Antworten (1)

Azzi Abdelmalek
Azzi Abdelmalek am 27 Dez. 2014
Bearbeitet: Azzi Abdelmalek am 27 Dez. 2014
yourarray=[1 2 3 4 5]
out=cumsum(yourarray)
  5 Kommentare
maha ismail
maha ismail am 27 Dez. 2014
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 am 27 Dez. 2014
Bearbeitet: Azzi Abdelmalek am 27 Dez. 2014
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)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with MATLAB 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!

Translated by