Help me with a function.

2 visualizzazioni (ultimi 30 giorni)
Aniruddha Das
Aniruddha Das il 6 Giu 2020
Risposto: the cyclist il 6 Giu 2020
I want to get a row matrix A from a parent row matrix B, where, the each component of A are the sequential sum of the components of B.
For e.g if B = [1 5 14 7 3] then A should be [1 6 20 27 30]
Please help.

Risposta accettata

the cyclist
the cyclist il 6 Giu 2020
A = cumsum(B);

Più risposte (0)

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by