LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I count the number of 1's in a Boolean Array??

I have a boolean array of 1000 0's or 1's and want to know the number of times this array is in the 1 position.

The array is repeated within a structure and i need a number for each iteration to be passed onto the next (using a shift register).

Never really used boolean arrays before so none of the standard things i use seem to work?

Thanks in Advance.

Ross
Message 1 of 4
(10,067 Views)
Ross,

The quick easy way is to convert the boolean array to a 0-1 array from the boolean menu, then sum the array using "sum array elements" from the numerical menu.

Bruce
Bruce Ammons
Ammons Engineering
Message 2 of 4
(10,067 Views)
Ceers Bruce, works a treat.

Ross
0 Kudos
Message 3 of 4
(10,067 Views)
Cheers Bruce, works a treat.

Ross
0 Kudos
Message 4 of 4
(10,067 Views)