LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

adding new values to an array after comparison

I'm try to parse through an array using a For loop.  In each iteration, I want to compare the array value to another constant value and indicate whether the condition is true or false.  I would then like to take that value and place it in a new array if the condition is met.  After the end of all comparisons, I would like to get the new array size so I can see how many array values met the condition.  Any suggestions?  This sounds simple enough, but my problem seems to be creating the new array.
0 Kudos
Message 1 of 5
(2,935 Views)

Message Edited by Michael Aivaliotis on 05-29-2007 10:49 AM



Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 2 of 5
(2,931 Views)

Just initialize an empty array in a shift register, then append matched elements using "built array". (The FALSE case has the array wired through).

I assume you know how the get the array size at the end. 😉

Message Edited by altenbach on 05-29-2007 07:58 AM

0 Kudos
Message 3 of 5
(2,925 Views)
Of course you don't say if you need that array at the end or if all you really need is the number of matches.
 
If you are only interested in the number of matches, it is a huge waste of resources to built that array. In this case you could use something like the two alternaties shown here instead: 🙂
 
 
 
 

Message Edited by altenbach on 05-29-2007 08:08 AM

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

If you are only interested in the number of matches, it is a huge waste of resources to built that array. In this case you could use something like the two alternaties shown here instead: :)
 
 

I agree.


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 5 of 5
(2,903 Views)