exponential4mpfit.pro 382 Bytes
FUNCTION exponential4mpfit,x,param

;param=[a,b] for y=a*x+b
;meant to be used by exponential_mpfit.pro
;parameters [Amplitude,cste,tau,x0]

y=1.d0*x
ind_inf=where(x LE param[3],count_inf,complement=ind_sup,Ncomplement=count_sup)
IF count_inf NE 0 THEN y[ind_inf]=param[1]
IF count_sup NE 0 THEN y[ind_sup]=param[0]*(1.-exp(-(x[ind_sup]-param[3])/param[2]))+param[1]

RETURN,y

END