I have a matrix Cr:
How can I replace zeros with last non-zero index? For example, output should be like this:
141 141 141 142 ... 141 141 141 142 ... 141