Hi there, I have an array (4048x1) full of 1s and -1s. I want change it so that, if there are more than 10 consecutive 1s or 10 consecutive -1s, then the rest of the consecutive elements after the 10 will become 0 (zeros).
Ie, if we have 1 -1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 -1 1
we would want 1 -1 1 1 -1 -1 1 1 1 1 1 1 1 1 1 1 0 0 -1 1 -1 1
Thanks
1 Comment
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/81122-converting-elements-which-repeat-more-than-10-times-to-0#comment_158325
Direct link to this comment
https://ch.mathworks.com/matlabcentral/answers/81122-converting-elements-which-repeat-more-than-10-times-to-0#comment_158325
Sign in to comment.