LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

delete 0 from array

Solved!
Go to solution

how do i delete the 0s from this array? Its been a while and I am still trying to learn how to do this. thanks

 

untitled.PNG

0 Kudos
Message 1 of 25
(15,884 Views)

Just right click the element.  I think it's under data operations delete element.

0 Kudos
Message 2 of 25
(15,879 Views)

Right Click on the element, go to data operations, choose delete.

 

 

-------
Mark Ramsdale
-------
0 Kudos
Message 3 of 25
(15,875 Views)

i have another subvi that creates this array.

i just need to delete 0s somehow.

i need to write a loop to delete it but nothing seems to work

0 Kudos
Message 4 of 25
(15,868 Views)

HINT: For Loop, case structure, build array, shift register, "Equal to 0?"

TailOfGon
Certified LabVIEW Architect 2013
0 Kudos
Message 5 of 25
(15,858 Views)

Please post what you have tried.

 

I would recommend you look at the help files for "Search 1D Array" and "Delete from Array".

 

I would also recommend you do a forum search.

0 Kudos
Message 6 of 25
(15,856 Views)
Solution
Accepted by HelloKristy

Hi,

 

here is a snippet to do that.  Copy to desktop and drag onto VI.

 

Remove zero.png

-------
Mark Ramsdale
-------
0 Kudos
Message 7 of 25
(15,855 Views)

Do you only need to delete from the beginning (all up to the first non-zero value) or throughout the entire array?

 

If the former, use a for loop with the termination set to exit when a non-zero value is found.  Take the iteration, feed that into a subarray primitive.

 

If the latter, use the Search 1D Array function to find the 0s and Delete from Array to remove the elements.


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 8 of 25
(15,850 Views)

Mark,  the appropriate function to use in 99% of the cases is Build Array, not Insert into Array.

0 Kudos
Message 9 of 25
(15,840 Views)

Agreed, thanks for the reminder Smiley Happy

-------
Mark Ramsdale
-------
0 Kudos
Message 10 of 25
(15,836 Views)