12-16-2011 11:52 AM
Hello,
I have 1D array with 10 measurement points. I treat the points in pairs and depending on the difference between the two consecutive points I make decision weather the two points should stay in the array or should be rejected. For an example my 1D array looks like this: 10, 20, 30, 35, 40, 44, 50, 51, 60, 69. I calculate the difference between consecutive points in pairs: 20-10=10, 35-30=5, 44-40=4, 51-50=1, 69-60=9. I would like to reject from the array the points with the difference value smaller than 2. So in my case that points are 50, 51, and the array after the rejection should have 8 elements and look like this: 10, 20, 30, 35, 40, 44, 60, 69. What is the most elegant way to do it? I am running LabVIEW 8.6.
Thanks in advance!
Solved! Go to Solution.
12-16-2011 12:32 PM
You are going to have to loop through the array checking each two data pair.
What if you have 3 consecutive points with difference value smaller than 2?
12-19-2011 02:53 AM
Hello Omar,
thanks, it works, but your question is relevant. If the two pairs with the differences smaller than 2 are consecutive it will not work. Have you any suggestions?
12-19-2011 08:14 AM
What if your array contained
10,20,21,22,23,24,25,30
Would you reject 20,21,22,23,24,25 leaving only 10,30 as your output?
If not, then we need better defined requirements.
12-19-2011 08:41 AM
Reviewing your original post and your example to better understand your stated requirements.
"I treat the points in pairs"
Are you required to only consider the 1st and 2nd point pair, then only consider the 3rd and 4th point pair so on and so on.
Never consider the 2nd to the 3rd or the never consider the 4th to the 5th so on and so on?
How big is your array? If it is very large (1000000 of points) you might need to consider other options for speed and memory usage.
12-19-2011 02:15 PM
Hi OmarGator
My arrays are up to 20 points. The problem is solved.
Thanks!