LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Urgent:Remove a known pattern from a boolean array

Solved!
Go to solution

Hi , I have a big chunk of boolean data and I would like to search the following pattern "111000" through the whole data and delete this repeated pattern from  data. I would greatly appreciate if you could show me how to do it in LabVIEW. A sample code would be great. Also is there any wany to keep the index of the first 1s of this pattern

 

for example 0101100110(1110000)1011001100101(111000)011001  to 01011001101011001100101011001

 

Many thanks

 

0 Kudos
Message 1 of 8
(2,467 Views)

See attached.

 

"Also is there any wany to keep the index of the first 1s of this pattern"

 

Can you elaborate? I don't quite understand it.

 

Kas

0 Kudos
Message 2 of 8
(2,462 Views)

Many thanks . May array is boolean not string.Is there any way to convert the boolean to string and then from string to boolean?

 

0 Kudos
Message 3 of 8
(2,457 Views)

My appologies. I didn't read carefully enough Smiley Sad.

 

See the attached again. 

 

Kas

0 Kudos
Message 4 of 8
(2,452 Views)
Solution
Accepted by topic author tintin_99

@zerotolerance wrote:

My appologies. I didn't read carefully enough Smiley Sad.

 

See the attached again. 


Your code seems to be limited to 64 booleans, which I don't consider a "big chunk" as described in the initial problem.

 

Here's what I would do. Modify as needed. (Of couse it is possible that after the pattern replacement, new pattern matches are possible, so you might need to do multiple passes until no more replacements are made).

 

Download All
Message 5 of 8
(2,444 Views)

"Your code seems to be limited to 64 booleans".

 

I thought about that, but I could never come up with a quick and clean solution. Nice one. 

 

 

0 Kudos
Message 6 of 8
(2,436 Views)

Of course if the arrays are truly gigantic, I would probably try a solution that operates directly on the 1D array "in place". Shouldn't be too hard. 😉

0 Kudos
Message 7 of 8
(2,422 Views)

Many thanks zerotolerance and 

0 Kudos
Message 8 of 8
(2,388 Views)