11-19-2010 07:33 AM - edited 11-19-2010 07:36 AM
I have a large integer array that was read from a spreadsheet. All ones and zeros.
The array is 200,000 words long by 10 bits wide. I need to convert this to a boolean array in order to
create a digital waveform graph. I can convert it using loops but this will take over an hour.
Is there a quick way of converting a 200,000x10 array of ints to a bool array?
Solved! Go to Solution.
11-19-2010 07:40 AM
Wayne,
What do you mean by 10 bits wide? You refer to the array as 200000x10 in the next paragraph. If this is an array of integers, then every cell will contain an integer. The AxB notation usually refers to rows and columns in the array.
Next question: How do you convert each integer to boolean? Is it 0 = False and anything else = True? Or do you want 10 booleans for each 10-bit integer? These two produce very different results.
Most numeric and boolean functions are polymorphic, meaning that they work equally well on a single integer or an array.
Lynn
11-19-2010 07:46 AM
Right... 200000 rows by 10 columns.
Each cell does contain an integer (either a zero or a one, nothing else). I need each cell to contain a boolean value.
One boolean value for each integer.
If cell = 0 then false.
If cell = 1 then true.
11-19-2010 08:16 AM
This should be much faster than loops. I did not try it with a large array.
Lynn
11-19-2010 08:28 AM
Perfect! So simple!
Thanks!