How to remove zero columns from array

后端 未结 4 1739
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 00:01

I have an array which looks similar to:

 0     2     3     4     0     0     7     8     0    10
 0    32    44    47     0     0    37    54     0    36
         


        
4条回答
  •  我在风中等你
    2020-12-12 00:11

    Also by reshaping nonzeros(x) as follows:

    reshape(nonzeros(x), size(x,1), [])
    
    ans =
    
         2     3     4     7     8    10
        32    44    47    37    54    36
    

提交回复
热议问题