LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

polyfit errors

I am getting the following error when using the polyscript function in the mathscript node (and in the mathscript window, for that matter):
 
Error in function polyfit at line 1.  A problem occurred in a subVI call.
Here is a code snippet:
 
A=M( 1 , : )
X=(1:704)
[p,s]=polyfit(X,A,8)
where M is a 704x704 matrix.
 
Has anyone else experienced this? What am I doing wrong here? I'm using LV 8.0.1, and also saw the error in LV8.0.
 
Thanks!

Message Edited by vituning on 05-09-2006 08:15 AM

0 Kudos
Message 1 of 5
(8,186 Views)
Hello,

You have found a problem in our polyfit function.  Under certain circumstances, it produces the nondescript error you encountered.  We are investigating a fix for a future release of LabVIEW.  To ensure that your situation is addressed, can you provide more information about the M matrix?  For example, could you provide the code that computes M (or at least the first row of M)?

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 5
(8,173 Views)

Grant -

I could easily repeat this error by simply changing the help example (wich uses random data) to call:

[p, s] = polyfit(1:36, rand(1,36), 6)

By playing either with the order or the size of the random vector created here, you can generate the error (order 5, size 400, for instance also gives the error).

For testing purposes, two cases that do not produce the error are: order=6, size=24 and order=5, size=10 (the example listed in the help).

I hope this fix makes it into the next version of LV!

0 Kudos
Message 3 of 5
(8,169 Views)
Thank you for the data.  We found a trivial case of linear data that produces the error, but the configurations of random data you provided will help us out, too.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 4 of 5
(8,165 Views)
Grant - one other thing: it doesn't seem to matter what the data is. Any time I run the random number generator with this specific size and order, I get the error. That is, a random vector is generated each time I run it for a given size and order, and it always (or never) produces the error. Just thought tat was interesting.
 
Good luck.
0 Kudos
Message 5 of 5
(8,162 Views)