01-18-2011 05:39 AM - edited 01-18-2011 05:43 AM
Well guys I have an array that gives me positive and negative values.
I need to use this array and get 2 new arrays, one is the array of positive values, second is the array with negative values, after that i have to get 2 values from it, one is the sum of all positive elements and i need to know how much positive elements too.
the second value is the sum of all negative elements and how much negative elements too.
Example:
Array: 5, -12, 2, -3, 4
First Array: 5,2,4
First Value: 5+2+4 = 11
Numbers of elements: 3
Second Array: -12,-3
Second Value: -12+(-3) = -15
Numbers of elements: 2
Something like that!
Thanks
Solved! Go to Solution.
01-18-2011 05:46 AM
Something like this maybe, assuming zero is positive.
01-18-2011 06:01 AM
Hey Dan thanks for the example, it works for me but I need get 2 arrays too
one with all positive values, and the other with all negative values!?
it can be made?
Thanks
01-18-2011 06:02 AM
Hi,
The attached code will work for your requirement..let me know if you have any problem with this..
01-18-2011 06:15 AM
EduU,
There are plenty of ways to do this, here is just one:
Rgs,
Lucither.
01-18-2011 06:20 AM
G.K and Lucither could you guys make it to 8.6 LabVIEW version?
I can't use the option to take the image and put into labview.
But thanks for the help guys
This probably will solve my problem!
01-18-2011 06:22 AM
No worries,
Here it is in 8.6
Rgs,
Lucither.
01-18-2011 06:23 AM
if you want the ending array add a biuld array to both the cases like this:
01-18-2011 06:28 AM
here is my 8.6 version
01-18-2011 07:15 AM
Thanks for all the solution!
I used the Harold Timmis as my solution
But all others give me a really nice feedback!