LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to know if there are more positive or negative numbers?

Solved!
Go to solution

I will try to explain my problem with an example, since in the computer I don't have labVIEW installed.

 

I have 10 numbers and multiply it for 10 other numbers

and of course i will have 10 results, after it I have to show the meddium value of this 10 results and have to show the signal that most appear (+ or -)

My problem is to show the signal, if I have 7 negative numbers and 3 positive numbers, how can I measure it and show the negative signal in the final?

 

example:

 

-0,3 -0,8 1 0,3 0,6 -0,7 -0,1 -0,5 0,3 -0,4

So i have to put in the final:

- 0,5

 

Thanks

 

0 Kudos
Message 1 of 9
(3,245 Views)

Are you looking for mean, perhaps?

 

Your question is not clear at all, though. Do you also want to count the positive and negative occurences? There is no signal that "appears most", but that would be the mode.

0 Kudos
Message 2 of 9
(3,231 Views)

Well I need the mean of the numbers, this I already know how to make

and I need the mode, example I have 7 negative numbers and 3 positive numbers so the majority is negative,

the final result will be the mode with the mean, like: - 0,5

 

Sorry but without LabVIEW in this computer I couldn't figure a better wat to explain it =/

0 Kudos
Message 3 of 9
(3,219 Views)

You are not precise enough. Do you mean the geometric mean, arithmetic mean, or median. If you do not know the meaning, you should look it up in wikipedia.

0 Kudos
Message 4 of 9
(3,208 Views)

@EduU wrote:

Well I need the mean of the numbers, this I already know how to make

and I need the mode, example I have 7 negative numbers and 3 positive numbers so the majority is negative,

the final result will be the mode with the mean, like: - 0,5



I count 6 negative numbers in the example you provided. Also, for the example provided the mode is 0.3. I don't undersand what "the mode with the mean" is supposed to errrr... mean. I don't see where you got -0.5 as the final answer.

0 Kudos
Message 5 of 9
(3,199 Views)

Here is code that gives you -0.5 from the given data. Still, sounds pretty useless. 😄

 

Message 6 of 9
(3,192 Views)

Joseph loo, Sorry but I only need to know if there are more negative or positive numbers, The numbers I put is just an example.

 

smercurio_fc, I got - 0,5 because I use absolut values, but don't need to focus on the value.

 

altenbach, Thanks for the picture, but I don't need calculate the value, I only need to see if there are more negatives or positive values.

 

I attached a picture that I have 5 numbers, 3 negatives and 2 positives, I only need to know how can I know that I have more negative numbers, remember this is an example.

0 Kudos
Message 7 of 9
(3,158 Views)
Solution
Accepted by EduU

You can do something similar (simplified) than altenbach proposed:

More positive numbers

If the output is True your array has more positive numbers.

 

Message 8 of 9
(3,145 Views)

Thanks dan_u! This is exactly what I need.

0 Kudos
Message 9 of 9
(3,140 Views)