10-14-2013 11:49 AM
I am trying to use a MathScript node in a simple test VI that fits a 2D Gaussian function to some imported data. The fitting function appears to work fine, but when I try to use the 'lsqfit' function I get the following error:
"Error -90046 occurred at Error in function lsqfit at line 7: The input parameters are not in the required format."
As far as I can tell all the inputs are in the correct format, and if I comment out the function call to 'lsqfit' the VI executes fine. I've attached my VI file, my fitting function file (as a .txt file), as well as some sample data. What am I missing here?
10-14-2013 08:08 PM
Hi,
The lsqfit function requires that xdata and ydata are 1-D arrays of the same size. In your script, x has 150 elements while y has 22500 elements. Then, the function returns error.
10-14-2013 11:12 PM
Ah, that makes sense. Thank you for pointing that out. I'll make the correction tomorrow. It would be nice if LabVIEW gave more descriptive error messages.