LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

least squares

I want to perform a linear fit by using least squares method. For example: I have x1, x2, x3, x4, x5, and I also have corresponding 5 measurements for each xi, i.e., (y11, y12,...,y15), (y21, y22,...,y25),..., (y51, y52,...,y55). I need to use these data to construct a linear function. How to do that?

Thank you very much!
0 Kudos
Message 1 of 3
(2,672 Views)
Create a 1D array of your x-values and a 1D array of your y-values. Feed the two arrays to "linear fit.vi". Voila!

(Required LabVIEW full or above).

EDIT:
In your case the x-array would be

[x1,x1,x1,x1,x1,x2,x2,x2,x2,x2,x3,x3, ..., x5,x5,x5,x5,x5]

and the y-array would be:

[y11,y12,y13,y14,y15,y21,y22,y23, ....., y54,y55]

Message Edited by altenbach on 05-03-2005 09:32 AM

0 Kudos
Message 2 of 3
(2,667 Views)
See attached code which implements Altenbach's method.

Message Edited by SciWare on 05-03-2005 11:54 AM

Kurt Friday
www.sciware.com.au
0 Kudos
Message 3 of 3
(2,653 Views)