06-19-2023 03:36 AM
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.
06-19-2023 03:52 AM
can you share your VI
06-19-2023 04:18 AM
Hi I can't sorry , I am not allowed to share anything as I'm an intern
06-19-2023 04:24 AM
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
06-19-2023 04:29 AM - edited 06-19-2023 04:36 AM
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 ...
06-19-2023 04:35 AM
06-19-2023 04:42 AM
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
06-19-2023 04:46 AM
06-19-2023 05:04 AM
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.
06-19-2023 05:42 AM
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