LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Numbers from Array

Hello,
i want to create a VI which does something what sound easy but i cant find out how to do it:

Input-Parameter:
1. Numeric Array_in (Int32)
2. tolerance (Int32)

Output Parameter:
1. Numeric Array_out (Int32)


For example:
Input:
Tolerance: 10

100
200
201
300
109
400
405
0
900

Output:
100
201
300
109
405
0
900


The VI should remove all numbers from the array which are equal (plus/minus the tolerance set by the second input parameter).
But: Only numbers which are next to each other should be removed. As you can see in the example there are two pairs of equal numbers +/- 10%: . There is 200&201 and 400&405. The VI sould remove the first number of a pair if they are equal.

Any idea how to solve this problem?
Thank you very much for your help.

0 Kudos
Message 1 of 11
(3,719 Views)
What happens when there are more than one in a row like the following...
 
Input:
Tolerance: 10

100
105
109
110
120
115
 
What would happen in this case?  Would it be:
 
100
105
109
110
120
115
 
 
0 Kudos
Message 2 of 11
(3,710 Views)
What happens when there are more than one in a row like the following...
 
Input:
Tolerance: 10

100
105
109
110
120
115
 
What would happen in this case?  Would it be:
 
100
105 
109
110
120
115
 
 
0 Kudos
Message 3 of 11
(3,710 Views)
What happens when there are more than one in a row like the following...
 
Input:
Tolerance: 10

100
105
109
110
120
115
 
What would happen in this case?  Would it be:
 
100
105  
109
110
120
115
 
 
0 Kudos
Message 4 of 11
(3,710 Views)
What happens when there are more than one in a row like the following...
 
Input:
Tolerance: 10

100
105
109
110
120
115
 
What would happen in this case?  Would it be:
 
100
105   
109
110
120
115
 
 
0 Kudos
Message 5 of 11
(3,710 Views)
What happens when there are more than one in a row like the following...
 
Input:
Tolerance: 10

100
105
109
110
120
115
 
What would happen in this case?  Would it be:
 
100
105    
109
110
120
115
 
 
0 Kudos
Message 6 of 11
(3,711 Views)
OMG!
 
My freaking keyboard got stuck... im sooo sorry.
Being able to remove a post within 1 minute would be a nice option!
0 Kudos
Message 7 of 11
(3,710 Views)

Use something like in the attached. (LabVIEW 7.1).

(Since percentages are a little tricky with integers, I am looking at the absolute difference instead.)

0 Kudos
Message 8 of 11
(3,706 Views)
Hello Chaos,
thanks for that hint but this case will not occur.
0 Kudos
Message 9 of 11
(3,692 Views)
Hello altenbach,
thx for the vi. Works great with the absolute value.
Its not a must that its an Integer-Array. Do you know how to do the percentage-thing with doubles?

Thx
0 Kudos
Message 10 of 11
(3,690 Views)