LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best linear fit of data in array

Hi there,
I have attached the simulation of a program I am using. It is to take in values from DAQ card and I then have to perform calculations and finally use the slope of best fit line to find the value I'm looking for(Reverberation number). I’m using a vi I found to get the slope and the best fit line. The slope value is fine but when I graph the best fit line the line can be clearly seen to be bending on the graph. Why is this and is there any way to solve it?
I would appreciate any help.

Thanks
Karen
0 Kudos
Message 1 of 3
(2,846 Views)
Hi Karen

The linear fit is Ok its just that your x values were not uniformly spaced. Hence when you plotted the fit on a waveform graph they looked distorted because you were essentially imposing a uniform spacing.

I've modified your code so that the x,y and x,yfit are shown on an XY Graph, which now shows the linear fit as a straight line.
Kurt Friday
www.sciware.com.au
0 Kudos
Message 2 of 3
(2,832 Views)
That would make sence... Thanks a million
0 Kudos
Message 3 of 3
(2,819 Views)