Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
i want to sum each row of a matrix to the next row of the same matrix and save it in a new variable. its a part of big algorithm.
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
let the matrix is this
A= [1 2 3 4; 5 6 7 8; 4 3 2 1];
and i want to get this
X=[1 2 3 4; 6 8 10 12; 10 11 12 13];
thanks in advance...
0 Commenti
Risposte (2)
Sheharyar Mr
il 23 Gen 2020
1 Commento
Walter Roberson
il 23 Gen 2020
Yes, you can call cumsum inside of loops.
Perhaps what you are looking for is something like
C(k+1,:) = C(k, :) + A(k+1, :)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!