04-07-2024 12:38 AM
Hi Guys,
I have a set 1D of array with array size of 60.
I sorted them and now need to know the top and bottom 5% value.
Suppose, the 1D array:
0.0006
0.0056
0.5
0.57
0.73
1.67
3.56
10.45
11.32
13.45
I need to divide this array into 3 sections: mean value, top 5% and bottom 5% value.
Can anyone gude me to do it?
04-07-2024 09:33 AM - edited 04-07-2024 09:36 AM
You posted a simple mathematical questions in a LabVIEW forum. Do you know the math and have trouble implementing it in LabVIEW? Do you have problem with the math itself?
@Hk637 wrote:
I need to divide this array into 3 sections: mean value, top 5% and bottom 5% value.
If you have 60 points, each point is ~1.67% of all points. So how many points would be 5%?
The mean value is a scalar, not a "section". Can you explain the terminology and what you mean by "divide the array"? Obviously this is not a mathematical division, but a splitting.
04-09-2024 02:10 AM
Hi, as altenbach mentioned, it is just a mathematical problem, but here is an example of how it could be done in case you still have doubts.
I would like to comment that depending on whether you are looking for exactly 5% or rounding, you should use an "absolute value" or not.
Best regards, a beginner in LabVIEW (2018, 2020, 2021)
04-09-2024 02:14 AM
Hi jcosta,
@jcosta1 wrote:
here is an example of how it could be done in case you still have doubts.
You know your two FOR loops do just the same as an ordinary ArraySubset function?
And you could also replace the whole ReverseArray+FOR+ReverseArray by a simple DeleteFromArray function?
04-09-2024 02:27 AM
Hi, that was my mistake, it really is much simpler and more efficient that way. Thank you very much for the correction and teaching.
Best regards.
A beginner in LabVIEW using LV2018/2020/2021
04-09-2024 03:16 AM
The compiler probably is smart enough to do this optimization for you, but instead of multiplying with 5 and dividing with 100 you can just multiply with 0.05.
04-09-2024 07:23 AM
Again, the title and initial information does not give a clear enough message as to what the OP is actually requesting. I looked at the data as all values that are within 5% of the Min-Max values.
04-09-2024 08:21 AM
I would use the built in percentile .vi
you can even look at the .vis blockdiagram and it is completly written in G...
04-10-2024 07:21 AM - edited 04-10-2024 07:24 AM
20 to 80 | 5 to 95 |
attached as labview 2020