LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a trendline plot in LabVIEW like Excel

I have searched the support pages in NI for this but couldn't find an adequate answer on how to plot the same trendline that Excel plots w/o using Excel.  I have tried the curve fitting functions in LabVIEW, but nothing comes close to the Excel trendline plot.
 
I submitted this question before under support request #7202957, but I quit my job before it was resolved.
 
Any ideas?
 
Thanks,
 
Todd
0 Kudos
Message 1 of 9
(8,688 Views)
A trendline is basically a curve-fit function, so perhaps you're not using the right parameters for the curve-fit function. Can you post your data, and perhaps a screenshot of what the Excel graph looks like. If you have an Excel workbook with the data and the graph, that would be great as well.
Message 2 of 9
(8,681 Views)

Here is a sample Excel spreadsheet with the data and trendline plot.

Any help would be very much appreciated!

Thanks,

Todd

0 Kudos
Message 3 of 9
(8,651 Views)
Hmm, with a different dataset I tried a month ago the express curve-fit plot (while configuring the express vi) never looked good, but with this dataset, it looks good, but the plot of evaluating the data via poly-eval is wrong.  Must be something simple I am doing wrong (see LV 8.5.1 attachment).
0 Kudos
Message 4 of 9
(8,635 Views)
Using the data from your Excel spreadsheet, this is what I get from the curve-fit functions:


Seems like a pretty-good fit to me. I'm not sure what you're trying to do with the polynomial evaluation stuff, though.


Message Edited by smercurio_fc on 07-30-2008 09:21 AM
Message 5 of 9
(8,609 Views)

I was only looking at the polynomial coefficients...didn't even think of checking the other outputs of the the poly-fit vi.  Thanks for pointing out the obvious to a 13 year LabVIEW veteran (mostly communications using RS232, TCP, ISO-9141, CAN, etc)!

Strange, why doesn't using the poly-coefficients (i.e. f(x)=a0+a1*x+a2*x^2+a3*x^3+a4*x^4+a5*x^5) create the same result?

0 Kudos
Message 6 of 9
(8,603 Views)
That's because in your code you were feeding the Y values to the Polynomial Evaluation function. That's why I said I didn't understand what you were trying to do with that function. Smiley Wink
0 Kudos
Message 7 of 9
(8,592 Views)
It figures...a simple (dumb) mistake was my problem all along!  Thank you for your help!
0 Kudos
Message 8 of 9
(8,577 Views)

This is an old thread but today I was struggling in plotting the next periods of a trendline like in Excel. So here is an example I did that could help someone else in the future.

Download All
0 Kudos
Message 9 of 9
(2,890 Views)