LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove blank entries in an array and replace them with proceeding values?

Solved!
Go to solution

I have an array elements with values and blank spaces. I want to arrange the elements such that the array only contains values eliminating blank spaces and rearrange the array with cotimuous values.  I am using a bollean array to fill in the elements, so the bolleans with false value fill in blank spaces which I dont want. How can I program the above operation?

 

Thank you,

Labview Learner
0 Kudos
Message 1 of 5
(3,501 Views)

Use a FOR loop.  You will need a shift register to hold the values.  If the current value is empty, then fill in with the value in the shift register.  Whichever value you indexed out, put in the shift register.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,497 Views)
It looks like you are still making channel selection several times more complicated than necessary. If you post your entire VI, we can add it to the rube goldberg thread.;-)
0 Kudos
Message 3 of 5
(3,492 Views)

The OpenG Filter 1D array will do this for you.  Give it the item(s) to filter and it will return an array with those elements removed.

0 Kudos
Message 4 of 5
(3,475 Views)
Solution
Accepted by topic author Ashaironix

Thank you for your solution, but I just figured out an easier way. CONDITIONAL INDEXING!. How can I miss that. Anyways, Thank you...

Labview Learner
0 Kudos
Message 5 of 5
(3,467 Views)