From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine what percentage of a boolean array is true or false?

I'm trying to figure out how to take a boolean array and determine what percentage of that array is true. So far I can only really find the AND Array Elements Function as far as evaluating the array goes, and my Google searches haven't come up with anything helpful. Is there a way to do this on Labview?

0 Kudos
Message 1 of 4
(1,844 Views)

snip.png

 

Something like this should work.

 

mcduff

 

EDIT: Do the summation after the division, otherwise you can have an overflow error.

Message 2 of 4
(1,840 Views)

gonna go ahead and try that. Thank you so much!

0 Kudos
Message 3 of 4
(1,831 Views)

Count the number of True elements in the array.

 

Use that number and the array size to calculate the percentage that is true.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 4
(1,784 Views)