This widget could not be displayed.
This widget could not be displayed.

LabVIEW MathScript RT Module

This widget could not be displayed.
cancel
Showing results for 
Search instead for 
Did you mean: 

MathScript

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?

Download All
This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 1 of 3
(6,871 Views)

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.

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
Message 2 of 3
(6,858 Views)

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.

This widget could not be displayed.
This widget could not be displayed.
This widget could not be displayed.
0 Kudos
Message 3 of 3
(6,854 Views)