01-24-2014 11:21 PM
I programmed a multipeak gaussian fit. Its displaying the following error
"Error -20041 occurred at NI_Gmath.lvlib:Nonlinear Curve Fit LM.vi:6620001"
Possible reason(s):
Analysis: The system of equations cannot be solved because the input matrix is singular.
Can someone help me on this?
Solved! Go to Solution.
01-24-2014 11:42 PM - edited 01-24-2014 11:43 PM
There seems to be a lot of unecessary and comvoluted code.
(e.g. the flat sequence could probably be replaced by a simple "reshape array", "element" should be an indicator. none of the local variables are needed. Same for the FOR loop at the end)
All your array controls are empty. Could you please put reasonable data into the controls (e.g. "A-mu-sigma"), make current values the default, save and attach it again.
01-25-2014 12:41 AM
The primary problem is the fact that to get the last element, you need to do Index = array size - 1 (first element is index=0!), yor model never sees the offset parameter
01-25-2014 01:08 AM
I cleaned things up a little bit and it all seems to work OK. (might need to tune the peak detector). LabVIEW 2013.
01-27-2014 09:30 PM
Yes. your programs work great. Thanks. Ya. I need to set a better way of inputting peak parameters but that can always be done interactively. Thanks for correcting and cleaning it.