01-16-2014 12:14 PM
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 🙂
Solved! Go to Solution.
01-16-2014 12:56 PM
Try "reshape array" (nothing to do with division). 🙂
01-16-2014 01:11 PM - edited 01-16-2014 01:11 PM
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.
01-16-2014 01:14 PM
Swap the two size inputs to the reshape function, then transpose afterwards.
01-16-2014 05:03 PM - edited 01-16-2014 05:08 PM
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.
01-17-2014 07:51 AM
thanks sir 🙂