LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do you know a VI or a mean to detect zeros in an array?

I'd like to remove zeros from an array .
Do you know a mean or a VI to do that?
Thank you for yours answers.
0 Kudos
Message 1 of 3
(2,387 Views)
To search for zeros, you can use the Search 1D Array function from the Array function palette. If the array if multi-dimensional, you can use Array Subset to operate on one row at a time.
How do you want to remove zeros? Do you want to shift all elements past the zero up? You can use Replace Array Subset in a loop. What do you want to do with the end of the array after you shifted elements up? Fill with zeros? You can use Replace Array Subset. Do you want to truncate the size of the array? You can use Array Subset.
Look at the array examples that ship with LabVIEW.
0 Kudos
Message 2 of 3
(2,387 Views)
look at this link
the Filter 1D array.vi coulb be a good start.

http://www.openg.org/projects/project.cgi?ID=37

hope it helps

Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
0 Kudos
Message 3 of 3
(2,387 Views)