02-16-2009 12:35 PM
Solved! Go to Solution.
02-16-2009 04:36 PM - edited 02-16-2009 04:40 PM
Heres one thing you could do:
Have your original data as two 1D arrays.
One is X values, and one is Y values.
Cluster those values together and that will be one data set.
Then, use the 'linear fit' function, and input your x and y arrays.
Use this new generated array of y-values and bundle them with the original array of x values.
If you build an array of the two data sets, then send them to an XY graph you should be all set.
Good luck 🙂
02-16-2009 05:07 PM
02-16-2009 06:36 PM
Well, I guess we would really need to know what the output of the buffer is as well as what you want to fit. The opposite of the bundle cluster is the "unbundle cluster" and you could write a loop to go through each element of the array.
02-17-2009 12:16 PM - edited 02-17-2009 12:17 PM
Is the image you showed me of your actual VI, or just an example?
That cluster is just one x value and one y value. How can you only fit one point to a curve?
You need to build an array of the x,y pairs each iteration
You would just need to use 'Unbundle' to split the x and y value.
Heres a sample of how your code should look.
The top half of the code was to take the data from being individual xy pairs, to an array of x values and an array of y values.
To split up the arrays and work with the data from there, you need whats in the red box.
02-17-2009 12:41 PM - edited 02-17-2009 12:42 PM
02-18-2009 10:53 AM
secr1973 wrote:
Yea, the pic is my vi. I see what you are saying and I understand that method. The chart buffer shown in my vi has a input of one x and y, it stores those values and adds to them in the next iteration. It outputs an array of clusters of x and y values. That is what I want to be able to split and use with the linear fit vi. Does that make more sense? Thanks
OK, I understand what you are doing. But why use a buffer? You can just build an array use a shift register.
That way, the arrays will already be seperated.
02-18-2009 04:34 PM