Matlab: Replace zeros with last non-zero index

后端 未结 0 1256
孤街浪徒
孤街浪徒 2021-02-01 02:23

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         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题