05-13-2013 08:41 PM
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
Solved! Go to Solution.
05-13-2013 08:54 PM - edited 05-13-2013 08:54 PM
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
05-13-2013 09:01 PM
Many thanks . May array is boolean not string.Is there any way to convert the boolean to string and then from string to boolean?
05-13-2013 09:30 PM
My appologies. I didn't read carefully enough .
See the attached again.
Kas
05-13-2013 10:08 PM - edited 05-13-2013 10:09 PM
@zerotolerance wrote:
My appologies. I didn't read carefully enough
.
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).
05-13-2013 10:25 PM
"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.
05-13-2013 10:37 PM
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. 😉
05-14-2013 12:42 PM
Many thanks zerotolerance and altenbach