Curve fitting function

Hi All,

I am trying to use the fitting option of Igor Pro. I have three graphs and want to apply an easy line curve fitting to each of those graphs. However, since two of the curves have the same waves, Igor creates a wave named fit_*. I am trying to use /D[=destwaveName ] to save the results as a separate wave. Here is the code I use:

Display F1_W vs F2_W // F1_W and F2_W are waves containing real numbers
ModifyGraph mode=3,marker=19,msize=1.1,rgb=(19456,39168,0)
ModifyGraph mirror=3, standoff=0
Make/N=2 fit_F1F2
CurveFit/NTHR=0 line F1_W /X=F2_W /D=fit_F1F2

Does anyone know how to use /D line for this purpose?

Thanks,
Emre
The /D flag with an explicit destination wave requires a wave with the same number of points as the Y data wave, the model values that are put into it are computed at the same X values as in your X input wave, and the result is not automatically added to your graph. Hm... did I list enough gotchas here? :)

So your code might be modified like this:
Display F1_W vs F2_W // F1_W and F2_W are waves containing real numbers
ModifyGraph mode=3,marker=19,msize=1.1,rgb=(19456,39168,0)
ModifyGraph mirror=3, standoff=0
Duplicate F1_W, fit_F1F2
AppendToGraph fit_F1F2 vs F2_W
CurveFit/NTHR=0 line F1_W /X=F2_W /D=fit_F1F2


Another option would be to simply rename the automatically-created fit wave:

Display F1_W vs F2_W // F1_W and F2_W are waves containing real numbers
ModifyGraph mode=3,marker=19,msize=1.1,rgb=(19456,39168,0)
ModifyGraph mirror=3, standoff=0
CurveFit/NTHR=0 line F1_W /X=F2_W /D
Wave fit_F1_W
Rename fit_F1_W, fit_F1F2


John Weeks
WaveMetrics, Inc.
support@wavemetrics.com