06-24-2016 09:28 AM
I have a XY graph which is consist of discrete points.Like
X Y
100 1.2
150 2.3
200 1.5
250 2
300 1.8
This is usually used as a correction curve,which shows a trend of the a Y value for a specific X.
OK,I have a new X but not in the XY graph points.For example X= 210.So how much should I get according to this XY graph?
Is there any functions in Labview to get it?
Solved! Go to Solution.
06-24-2016 09:30 AM
06-24-2016 09:34 AM
@GerdW wrote:Yes, there is a function: Interpolate1DArray…
This only works with even X spacing for your reference data, which it seems you have. If you have something slightly more complicated, you can use the Linear Fit VI from the Mathematics > Fitting palette.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-24-2016 09:55 AM - edited 06-24-2016 09:57 AM
If you represent the data as an array of points (cluster of x,y), you can use interpolate array and the spacing does not need to be equal.
Try this.
(you can even get the cursor x position from the event data node, but then you cannot combine with the timeout event to set everything before the cursor is moved for the first time).
06-24-2016 09:56 AM
Oh, that's a neat trick!
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
06-24-2016 09:59 AM
Thanks very much!
Another thing is that how to add a correction curve to a XY graph?
06-24-2016 10:02 AM
@avater wrote:Thanks very much!
Another thing is that how to add a correction curve to a XY graph?
Where do you get it from? Do you have a file?
Typically you would read it as a 2D array of DBL first. then you can slice out the frst and second row/colum as 1D arrays and wire these to a bundle node (x on top). To get a 1D array of points, wrap an autoindexing FOR loop around the bundle node.
06-24-2016 10:17 AM
@James.M wrote:Oh, that's a neat trick!
The problem is that I typically use complex arrays for XY graphs. Thus this idea. (Please vote for it! :D)
Maybe interpolate 1D array should accept all data types that can represent a plot in an xy graphs (1D array of points, cluster of 1D x and y arrays, complex 1D array, etc.).
See also the various links on the idea for futher discussion.
06-24-2016 10:21 AM
You are really a kind and nice person!
My case is I have 2 waveforms(wav1 and wav2) and I want to have another wavform(wav3,I called it as correction curve ).So wav1 + wav3 = wav2.How to get this wav3?
The other case is that I have wav1 and wav3,how to get wav2(corrected curve)?
06-24-2016 10:25 AM
Please attach your VI containing typical data.
(XY graphs are normally not used to graph waveform data (special datatype), so obviously we are missing crucial information)