Using Funcfit in a procedure with loops!
Dolbash
wave coeffs
Coeffs[0]=(v_max)/2 //these coeffs are the initial guesses
Coeffs[1]=v_max
Coeffs[2]=numpnts(fittederf)/2
Coeffs[3]=numpnts(fittederf)/4
variable m=0
Funcfit/q ErrorFunction,Coeffs,FittedErf //fitting command with proper locations of waves
Make/o/n=(numpnts(fittederf)*10) SmoothERF= Coeffs[0]+Coeffs[1]*(Erf((Coeffs[2]-(x/10))/(Abs(Coeffs[3])*sqrt(2))) //making a new wave with 10x points, but overall same domain
Coeffs[0]=(v_max)/2 //these coeffs are the initial guesses
Coeffs[1]=v_max
Coeffs[2]=numpnts(fittederf)/2
Coeffs[3]=numpnts(fittederf)/4
variable m=0
Funcfit/q ErrorFunction,Coeffs,FittedErf //fitting command with proper locations of waves
Make/o/n=(numpnts(fittederf)*10) SmoothERF= Coeffs[0]+Coeffs[1]*(Erf((Coeffs[2]-(x/10))/(Abs(Coeffs[3])*sqrt(2))) //making a new wave with 10x points, but overall same domain
June 26, 2018 at 04:32 pm - Permalink
June 26, 2018 at 04:55 pm - Permalink
Variable V_FitQuitReason=0
FuncFit ...
if (V_fitError)
... do something to interpret and report error ...
endif
if (V_FitQuitReason)
... report on termination reason ...
endif
June 27, 2018 at 11:22 am - Permalink