LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to separate an array into it's positive and negative elements?

I'm working with an array, and I'd like to be able to seperate this array into it's positive and negative elements. I'd like to be able to store each of these values in two other arrays (positive and negative arrays if you will). If anyone could suggest an algorithm for doing this, I'd appreciate any help I can get.
0 Kudos
Message 1 of 4
(3,672 Views)
If you go to Help>Fundamentals>Arrays you will find Separate Array Values.vi that does exactly what you need.
Message 2 of 4
(3,672 Views)
Perfect! Thanks a lot, I was wondering why there was not a subvi for this...guess I couldn't find it
0 Kudos
Message 3 of 4
(3,672 Views)
Actually, if you slightly modify the VI in the example, you can use it as a sub-VI for your application. In the front panel, right-click the VI's icon located on the top-right of your VI. Then select "Show Connector" and add the necessary connetcors to the VI (One for the input and two for the output) for the VI so it can be used as a Sub-VI. Save it with a different name and location so you don't change the original.
www.vartortech.com
0 Kudos
Message 4 of 4
(3,672 Views)