help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

filtering logical array


From: seektime
Subject: filtering logical array
Date: Tue, 26 Jun 2012 11:22:42 -0700 (PDT)

Hi, suppose you have a logical array such as 

> a=[0 0 1 1 1 1 1 0 1 0 1 0 0 1 0 0 1 1 0 0 0 0 0 1 1 1 0]; 

I'd like to filter this vector so it looks like this: 

> a 
 a=[0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0]; 

So consecutive 1's of 3 or more remain in the output while all other 1's are
set to false. 

Any help is highly appreciated. 

Thanks, 
Michael 


--
View this message in context: 
http://octave.1599824.n4.nabble.com/filtering-logical-array-tp4630983.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]