LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Removing Negative numbers from an array

Hello everyboday,
So far I have this

Untitled.png

 

After the user inputting the array elements, I want the program to remove negative elements and replace them with null,
Meaning simply removing them.
Here however, the program is replacing the negative elements with the value of zero, and I don't want that, I don't know with what I should replace the constant zero, or even if the whole program is correct.
Excuse me, but I'm still new to lab view, any help will be much appreciated !

0 Kudos
Message 1 of 7
(4,828 Views)

Null is not a valid DBL numeric. Can you explain what you want as replacement for negative values? (e.g. NaN). Or do you want to make the output array smaller by removing the negative elements and making the output array shorter??

 

Your code is about 90% too complicated. Learn about autoindexing!!!

 

What is your LabVIEW version? Do you have conditional tunnels?

 

In any case, this looks like homework. There are plenty of examples in the forum that show how to do all that. Did you try a search?

0 Kudos
Message 2 of 7
(4,823 Views)

Untitled.png

 

 

 

That's what I mean removing all the negative values, having a smaller array yes!.

And I have the 2011 version

0 Kudos
Message 3 of 7
(4,816 Views)

So what is giving you problems?

0 Kudos
Message 4 of 7
(4,798 Views)

With Build Array/shift register and also the new conditional tunnel.

 

 

EDIT:  Fixed lower loop.

0 Kudos
Message 5 of 7
(4,796 Views)

@RavensFan wrote:

With Build Array/shift register and also the new conditional tunnel.

 

(original image deleted, new one is OK)


 

Your lower version will not work. Is that intentional? 😄

0 Kudos
Message 6 of 7
(4,790 Views)