Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use polynomial curve fitting with x data that is not evenly spaced.

I have a very noisy set of data that I'm trying to analyze.  The data consists of several sets of X-Y points.  The X points are evenly spaced, but I have multiple sets in an attempt to provide more data to the curve fitting algorithm.  So I end up with multiple Y values for each X value.  When I attempt to use these arrays in
    CWStat1.PolyFit x, y, Order, FitData, CoEff, mse
command, I get junk.  If I only have one Y value at each X, then this generates a nice fit.  The problem is that once in a while I get a really bad number that throws off the curve.  I was hoping that the extra data would prevent this.  Any ideas?
0 Kudos
Message 1 of 2
(7,053 Views)
Hi GlennR2,

I would recommend averaging all data points and then doing the polyfit on the new normalized data.



Adam

National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(7,039 Views)