LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

divide boolean array

Solved!
Go to solution

hi sir, i just want to ask on how to divide  a 1-d boolean array. for example i want to put the first 32 bits into column 1, then the 2nd to column to and so on.. i just want to have a 2-d array of 32 bits per cell.. thank you 🙂 

0 Kudos
Message 1 of 6
(3,368 Views)

Try "reshape array" (nothing to do with division). 🙂

0 Kudos
Message 2 of 6
(3,322 Views)

My first thought was Reshape Array, but it doesn't do what I'd expect if the length of the input array wasn't a multiple of 32.  It makes each column 32 elements long, but divides the input array among them.  I don't know which behavior is desired and I expect that my top implementation isn't optimum.

 

Example_VI.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 3 of 6
(3,313 Views)

Swap the two size inputs to the reshape function, then transpose afterwards.

Message 4 of 6
(3,306 Views)
Solution
Accepted by topic author robin123_hood

Here is the simplest reshape code that pads the last row if needed.

 

 

 

If you can guarantee that the size is divisible by 32, or if you want to discard incomplete rows, just wire the "IQ" output directly to the upper size input and discard the extra math.

 

If you later want to process 32 elements at a time, reshaping into rows of 32 is much more convenient, e.g. by using autoindexing in a FOR loop, processing one row at a time. Of course if you want columns instead, transpose after reshaping as already mentioned.

Message 5 of 6
(3,283 Views)

thanks sir 🙂 

0 Kudos
Message 6 of 6
(3,229 Views)