LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Deleting zero values from array/case q

Hi
 
does anyone know how I can delete zero values from an array but keep the order of the remaining numbers. Alternativly I have a case structure and in the TRUE case I want to input values to an array but in the FALSE I don't want to input anything this is not possible as the tunnel of the case structure is not wired in the false case, is there any way I can put data into the array in the tru situation but not the false. At the moment I am entering zeros where the case is false but then need to delete them. thanks
 
emily
0 Kudos
Message 1 of 2
(2,575 Views)
Both things are easy to do. You can auto-index the array into a for loop, compare each value, and in one case statement, use the build array function on an array maintained by a shift register. In the other case statement, wire the shift register straight through. Look at the shipping example called Separte Array Values to if you're having a hard time understanding. OpenG has a function called Filter 1D that will work too. You can also avoid adding the zeroes in the first place with a shift register. Assuming that a while or for loop surrounds your case statement, create a shift register and in the false case, simply wire the shift register straight through.
0 Kudos
Message 2 of 2
(2,567 Views)