LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build decimal array subset from a boolean array

Solved!
Go to solution

I have a decimal array  1 2 3 4 5 6 , and I have a boolean array with same size 0 1 0 1 1 0,

How do I extract the subset of decimal array from the corresponding "1" position of boolean array ( in this case 2 4 5 ) ?

The value of boolean array can be changed ( coule be  1 00100) , so the size of the subset decimal array is not fixed ( 1 4 ).

 

 

0 Kudos
Message 1 of 2
(2,787 Views)
Solution
Accepted by topic author mathink

(I assume you mean numeric array. "Decimal" is just a formatting specification and irrelevant for this) 

 

Try something like the following (The FALSE case has the array just wired across unchanged):

 

 

(In case you are dealing with gigantic arrays, a few performance modifications should be made so things happen more in-place.)

 

(sorry for the spelling errors, just ignore them ;))

Message Edited by altenbach on 02-07-2009 11:27 AM
Download All
0 Kudos
Message 2 of 2
(2,780 Views)