I am trying to create a link to the maximum value observed at a particular point in time. Here is an example of what I'm trying to do. Each line is processed individually. I have considered some combination of row and column application, but I want to be able to calculate this for the whole matrix right away without using loops.
Say I have a matrix
1, 2, 3, 2, 2, 5, 4, 5, 7
2, 3, 3, 4, 2, 3, 5, 4, 6
I want to create a new matrix that looks like
1, 2, 3, 3, 3, 5, 5, 5, 7
2, 3, 3, 4, 4, 4, 5, 5, 6
Thank.
source
share