LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delete values from X and Y arrays

Hi I have a big BIG struggle with this problem ( new to labview ) , 


I have two separate arrays of doubles. 
One X and the other is Y.

Example :
X = [1,2,3,4,5] 

Y = [10,20,30,40,50] 
When I bundle them to create a XY graph everything works fine. 
Now I want to set max and min range for the X array so I want to set the min to 2 and max to 4 . 
I have used the in range and coerce and it works fine I have X = [2,3,4] .

But I have no Idea how I can also synchronise the Y values after the deletion of X values. They are all shifted values .

I'm just trying to find a way to crop my XY graph by setting range in the X and Y arrays ( it's critical for me that I delete the Y values not just set them to NaN) 

I would like to share my vi but it will lead to  confusion, I just stated a simple example and will try to inspire from any solution given. 

Thank you.

0 Kudos
Message 1 of 17
(1,455 Views)

can you share your VI

CLA
Message 2 of 17
(1,445 Views)

Hi I can't sorry , I am not allowed to share anything as I'm an intern

0 Kudos
Message 3 of 17
(1,427 Views)

Am I correct understand?

Original X = [1,2,3,4,5] 
Original Y = [10,20,30,40,50] 

When you set min = 2 and max = 4
X will become [1, NaN, NaN, NaN, 5]

also Y will become [10, NaN, NaN, NaN, 50]

?? Is this your question?
Mazespin

please set this as ANSWER or KUDO this post, if it help you.


Message 4 of 17
(1,422 Views)

Original X = [1,2,3,4,5] 
Original Y = [10,20,30,40,50] 

When I set min = 2 and max = 4
X will become [2,3,4]

also Y will become [20,30,40]
X and Y are coordinate (X,Y) =  (2,20) ect ... 

0 Kudos
Message 5 of 17
(1,417 Views)

why the final co-ordinate still have 1 and 10 once they removed?

please set this as ANSWER or KUDO this post, if it help you.


0 Kudos
Message 6 of 17
(1,405 Views)

Fixed it ... at the end when I set the min and max values in the X array I want the Y array to delete the elements accordingly . 
The graph XY is originaly (1,10) (2,20) (3,30)
When I delete the X values from the X array my graph is shifted (2,10) (3,20). 
It's not what I wanted

0 Kudos
Message 7 of 17
(1,395 Views)

you just have to delete the Y array at the same position and same input with X. 
If I understand correctly, you want (2,20) (3,30) ?

 

you just copy & paste what have been done on X to Y.

please set this as ANSWER or KUDO this post, if it help you.


0 Kudos
Message 8 of 17
(1,390 Views)

X and Y are two separate arrays that are independent one another , the two are bundled to a cluster and set to a XY graph. 
The X array is 1 2 3 4 and Y is 10 20 30 40 
I want to set the range with only the control of the X values. 
In this graph that I use for example I want to plot the values between 10k an 15k , and delete everything below and above this range. 
signal-filtré.png

0 Kudos
Message 9 of 17
(1,360 Views)

deceased_0-1687171181778.png

 

You can do this with the remove outliers VI. Note that the range will not include values on the boundary so here 1 and 4 are excluded from the output, but 1.0001 and 3.9999 would have been accepted.

 

0xDEAD

0 Kudos
Message 10 of 17
(1,348 Views)