LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

PolyFit() generates NaN coefficients

I am trying to do a curve fit using the CVI 5.0 Advanced Analysis Library
function PolyFit(), as follows:

status = PolyFit (x, y, n, order, z, coef, &mse);

The input x[] and y[] arrays are double precision and all of the sample points
have been scaled to fall between 0 and 1. There are about 3,000 sample points.
I have tried using a polynomial order of various values between 1 and 10,
but no
matter what I do, the output coef[] array, the z[] array, and the mse error
value
all contain NaN (not a number) for each of their double precision values.
The return value (status) is 0. If I plot the x[] vs. y[] data on a graph,
the
distribution of the data points is such that I can easily visualize a curve,
but
PolyFit()
is somehow not working.

I have read and re-read the description of PolyFit in the reference manual
and have searched the Knowledge Base and CVI newsgroup to no avail.

Any suggestions?
0 Kudos
Message 1 of 2
(7,669 Views)
I'm also having problems with the Polyfit but not the same as you however. I'ne lso seen NaN values but that's only when I did not initialize the array that I've created.
Jattie van der Linde
Engineering Manager, Software & Automation
TEL Magnetic Solutions Ltd
0 Kudos
Message 2 of 2
(7,669 Views)