LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

integer array to bool array

Solved!
Go to solution

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?

0 Kudos
Message 1 of 5
(4,032 Views)

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

0 Kudos
Message 2 of 5
(4,024 Views)

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.

0 Kudos
Message 3 of 5
(4,019 Views)
Solution
Accepted by topic author WayneS1324

This should be much faster than loops.  I did not try it with a large array.

 

Lynn

 

Integer array to Boolean array.png

Message 4 of 5
(4,004 Views)

Perfect! So simple!

 

Thanks!

0 Kudos
Message 5 of 5
(3,993 Views)