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
(16,438 Views)

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

0 Kudos
Message 2 of 25
(16,433 Views)

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

 

 

-------
Mark Ramsdale
-------
0 Kudos
Message 3 of 25
(16,429 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
(16,422 Views)

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

TailOfGon
Certified LabVIEW Architect 2013
0 Kudos
Message 5 of 25
(16,412 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
(16,410 Views)
Solution
Accepted by topic author 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
(16,409 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
(16,404 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
(16,394 Views)

Agreed, thanks for the reminder Smiley Happy

-------
Mark Ramsdale
-------
0 Kudos
Message 10 of 25
(16,390 Views)