LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

extract selected equal values from 1-D Array

Hi there,

 

I'm looking for a way to extract equal values from and 1D Array and delete them. The problem here is, a comparision with a given value should decide which values get deleted and which ones are kept. 

 

precise explanation:

el_problemo.PNG

My Input Array (left) is 1D size with a cluster of 2 double values (x and y).

First of all the for-case (1) turns all equal values (x1=x2 & y1=y2) into 0s, afterwards the for-case (2) deletes all zeros from the cluster. This was my intention for deleting all points with the exact same coordinates.

At (3) I'm splitting my cluster into and X and Y Array.

 

Here's what I'm looking for:

The Cluster contains several points, which have an equal y-coordinate, but a different x-coordinate. I need to compare all those x-coordinates with a certain value and pic the x-coordinate which is the closest to the given value. The other points should be deleted.

I tried already several times, but failed all the time...

 

thanks in advance

Max

 

0 Kudos
Message 1 of 3
(3,098 Views)

Crosspost from German LabVIEWForum!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(3,079 Views)

Hi!

 

The below code will delete all values in an array that are equal to the value you have set to delete.

The for loop compares each element in the array to your value to delete. 

By using a conditional tunnel mode, the output array will only contain elements that are not equal to the value you want to remove.

 

deletearray.png

 

EDIT:

 

Here it is for an array of clusters as in your example.

 

deleteclusterarray.png

 

______________________________________________________________


______________________________________________________________
0 Kudos
Message 3 of 3
(3,075 Views)