How to eliminate zeros from array

1 次查看(过去 30 天)
Sarumathi C
Sarumathi C 2018-3-14
编辑: Birdman 2018-3-14
e.g I want to make this:
1,1,1,1,0,0 1,1,0,0,0,0 1,0,0,0,0,0 1,1,1,1,1,0 into this:
1,1,1,1 1,1 1 1,1,1,1,1
  1 个评论
Jos (10584)
Jos (10584) 2018-3-14
Can you give a an example of these two arrays in working matlab code?
Array1 = ...
Array2 = ...

请先登录,再进行评论。

回答(1 个)

Jos (10584)
Jos (10584) 2018-3-14
a(~logical(a)) = []
  5 个评论
Jos (10584)
Jos (10584) 2018-3-14
Please use valid matlab notation for the examples ...
Birdman
Birdman 2018-3-14
编辑:Birdman 2018-3-14
And maybe this should be a new question since it is hard to pay attention to this between comments, also you are off the topic of the question.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by