07-14-2013 05:37 PM
I have a small list of given x values and a large set of points in a cluster. I am trying to find the corresponding y values to the given x values. I tried using the interpolate 1d array function before I bundled the cluster but that did not give me the correct y values. I'm new to labview and any help would be much appreciated. Thanks.
Solved! Go to Solution.
07-14-2013 06:00 PM
Attach your VI so we can see you tried to interpolate 1-D array, then we'll be able to show you how to fix it.
07-14-2013 06:37 PM
Here is the VI I used
07-14-2013 06:41 PM
If you use interpolate array with an array of points, you get a linearly interpolated y value for x values that don't exist in the array of points. If you get something unexpected, show us your code. Make sure it contains typical data.
07-14-2013 06:45 PM - edited 07-14-2013 06:47 PM
@chazzchuzz wrote:
Here is the VI I us
That's not a VI, but a picture. Please attach the actual VI.
Also, where is the cluster you mentioned earlier?
07-14-2013 09:06 PM
Sorry about that. Here is the VI. Plasma emisions is the y coordinate of the cluster. Right now it is just an array, there is a cluster containing the emissions and the x coordinate in a different VI. I thought interpolate 1d array would work for getting the y value but it gives me the wrong value. Here is a snapshot of the file where the x and y coordinate lists came from. For x=800.62, I should be getting a value in the two thousands but I am getting something around -14. Thanks so much for the help.
07-14-2013 09:19 PM
We can't run your VI because you haven't included any of the data as default.
But looking at your VI, it looks like you are missing the Threshold 1D array. That will give you the fractional index of where 800.62 fits within your X array.
Then you apply that factional index into the Y array to find the corresponding Y value.
07-14-2013 10:01 PM
Wouldn't I need a y value in the first place to use the threshold function?
07-14-2013 10:15 PM
No.
You use your 800.62 into the threshold function on the X array. That gives you a fractional index.
Then you put that fractional index into Interpolate 1-D array acting on the Y array. Now you have the interpolated point out of the Y array.
07-14-2013 10:27 PM
It worked! Thanks a ton.