
Null(missing) wave during a fitting for user-defined function

imksh2000
coefwave = coefficient wave
I_exp = experimental data to be fitted
q_x = experimental X wave
I_fit = y wave destination
Function Do_Fit() wave coefwave, I_exp, q_x Duplicate/O I_exp I_fit I_fit = 0 FuncFit/NTHR=0 Fitting_Engine coefwave I_exp /X=q_x /I=1 /D= i_fit End
To test this, add this statement after the wave declarations:
I also recommend that you, and anyone else doing Igor programming, turn on "Debug on Error". For details, execute this:
In this case, the "NVAR SVAR WAVE Checking" feature will break into the debugger if coefwave, I_exp, or q_x do not exist.
Sometimes when there is an error and Igor breaks into the debugger, the arrow will point to the line AFTER the line that caused the error, so you need to be aware of that possibility.
March 25, 2016 at 09:28 pm - Permalink
After
return Fi_tot
, the fitting process does not works and no error massages appears in the Debug mode.The governing equation to fit is Fi_tot.
March 25, 2016 at 10:45 pm - Permalink
I recommend to at least go through the description of used-defined fitting functions by executing
DisplayHelpTopic "Discussion of User-Defined Fit Function Formats"
Anyway, try to express your problem so that you get a defined output y for an input x, and return that. Or rewrite your function to an all-at-once type.
March 27, 2016 at 10:28 pm - Permalink