02-24-2015 12:03 PM
Hi!
I have a waveform chart with a history lenght of 1024 data points (buffer).
Without exporting the file outside from labview, it would be really good if I could calculate a regression line on those 1024 points at the same time I am feeding the chart with new data. Till now, due to the characteristics of my application, I need to wait till I reach "steady state" conditions, then export the chart data to excel, and then make a regression line on that data (i am interested in the slope of that regression line).
Could you give some hints about how can I do that regression on labview? Is there any way to store that 1024 points in a buffer and keep calculating the regression line at the same time I get new data to the buffer and to the chart?
I hope I expressed myself so you can understand what I meen hehe
Thanks in advance
Pablo
Solved! Go to Solution.
02-24-2015 01:02 PM
Search the palettes for the function General Linear Fit. It will do the regression on the data you send it. Remember that charts basically just take pieces of data, or an array of data. In order to do a regression, you'll need the X data that goes along with the chart's Y data. That X data should be equally spaced intervals.
You can read the History property node of a chart in order to get the data that is currently within a chart. Or you can build an array of data stored in a shift register, add new data to it, and remove the old data when the array begins to exceed your desired length.
02-24-2015 01:21 PM
Hi
I am trying with the History property node of the chart. However, the output is an array of clusters, containing as many clusters as buffer size for the chart. Each of those cluster has 2 elements, because I display two "waveforms" in the same chart.
How can I get an array containing only the first element of each cluster of the history array (coming from the property node)?
Thanks!
02-24-2015 01:44 PM
Go to this idea and vote for it. Why is there no function to reverse "Index & Bundle Cluster Array"
What would make it easier to do this the function that is "missing" from LabVIEW. But the idea also shows you how to do it using a For Loop.
02-25-2015 03:01 AM
ok, thanks for the support!