Hello
can someone please help me with this challenge.
matrix
B = [1, 4, 3, 1, 3, 2, 1, 0, 0, 1, 5, 6, 9, 1, 3]A = cumsum (B);A = [1, 5, 8, 9, 12, 14, 15, 15, 15, 16, 21, 27, 36, 37, 40]
Then i want A and C to act like this
A = [1, 0, 3, 4, 0, 2, 3, 3, 3, 4, 0, 0, 0, 1, 3] % Every time it exceds 5, the value has to be moved to C, and reset to 0
C = [0, 5, 0, 0, 7, 0, 0, 0, 0, 0, 9, 6, 9, 0, 0]
Best Answer