LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV doesn't match Excel trendline equation

I know, another LV vs Excel issue. I can't seem to find satisfaction from the search so here it goes.

I have plotted some numbers in excel and had the chart display the trendline equation.
I then tried the same thing in LV.  The slope matches but the intercept does not.

Excel computes y=1.0096x + 0.4052.  LV gets y=1.0096x +.4066.
Is there something i can do to make LV match excel?
I can't change the excel sheet as it is used to calibrate some of our stands.  I'm trying to make the system automated so I don't have to use the sheet to do the computing and using LV to just enter the data in the excel sheet for record keeping.  I can just use ActiveX to exctract the trendline equation from the chart but I'd rather have LV do it.

X Values are:
-0.32268
10.8489
21.9037
33.1427
44.3617
33.2487
22.0309
10.6525
-0.4177

y values are:
0.00
11.30
22.60
33.90
45.19
33.90
22.60
11.30
0.00


-Keith
0 Kudos
Message 1 of 8
(3,714 Views)
I just put both into Excel and LabVIEW and I got the same answer for both, y=1.0096x + 0.4066

Mistype maybe???Smiley Surprised

I am using Excel 2003 and LV8.2.1


Kenny

0 Kudos
Message 2 of 8
(3,701 Views)
I'm using LV 7.1 and the same version of Excel.  I just created a new graph using the same data and I still get 1.0096 + 0.4052.
The chart is an XY scatter.  Is that significant?

Message Edited by kmiller on 07-25-2007 02:58 PM

0 Kudos
Message 3 of 8
(3,696 Views)
Here is my spreadsheet.  I am using the xy scatter as well.
Kenny

0 Kudos
Message 4 of 8
(3,689 Views)
Your sheet comes out correct on my computer. 
Here is my excell chart.
0 Kudos
Message 5 of 8
(3,680 Views)
I have found the problem.  Its the digits of precision that are displayed in the data . I compared the two data, yours and mine and they match but I got different results so I subtracted them and got a number difference.  My data has 3 hidden digits.  I plugged in the corrected data and everything is correct now. 

Thanks for your help! I wouldn't have gotten here this quick if I didn' have another pair of eyes looking at it.


0 Kudos
Message 6 of 8
(3,675 Views)
I hate when that happens Smiley Very Happy
 
Glad to hear you found it.  Good luck
Kenny

0 Kudos
Message 7 of 8
(3,672 Views)
Glad you found your problem, but something else to be aware of is that Excel only uses single-precision floats, where as the default for LV is double-precision. This means that you can get different results due to differing rounding error.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 8 of 8
(3,660 Views)