Appending Values to a Table

I am new to Igor and I am having a problem with programming.
My problem is I am calculating a value "integral" for several curvefits and I want to append those values into a column in a table. Please help and Thank you!

Menu "Macros"
"2D Guassian Fit...", My2DGaussianFit()
End
Function My2DGaussianFit()
    Variable L, H
    Variable ii
    Prompt L, "Enter Lowest Tw Value:"
    Prompt H, "Enter Highest Tw Value:"
    Variable xmin, xmax, ymin, ymax
    Prompt xmin, "Enter xmin value: " // Set prompt for x param
    Prompt xmax, "Enter xmax value: " // Set prompt for x param
    Prompt ymin, "Enter ymin value: " // Set prompt for y param
    Prompt ymax, "Enter ymax value: " // Set prompt for y param
    DoPrompt "Enter Parameters", L, H, xmin, xmax, ymin, ymax
    if  (V_Flag)
    return -1 // User canceled
    endif
    for  (ii=0; ii<(H); ii+=500)
        string  waveselection= "avg" + num2str(L+ii)
        Wave ws= $waveselection
        Wave w1
        Wave w3
       
        Display; AppendMatrixContour ws vs {w1,w3}
            ModifyContour $waveselection labels=0
            ModifyContour $waveselection autoLevels={*,*,35}
        CurveFit/NTHR=0 Gauss2D ws[xmin,xmax][ymin,ymax] /X=w1[xmin,xmax] /Y=w3[ymin,ymax] /D
            wave W_coef
       
            Variable integral
           
            if  (waveExists (W_coef))
           
            integral= W_coef[1]*2*pi* W_coef[3]*W_coef[5]*sqrt(1-W_coef[6]^2)
           
            Print integral
            endif
    endfor
End

I added formatting to your Igor code per http://www.igorexchange.com/node/3221

Quote:
My 1st problem is I am calculating a value "integral" for several curvefits and I want to append those values into a column in a table.

You need to create a wave using Make and then append data to it. For example:
Wave/Z/D integrals  // Look for integrals wave in current data folder
if (!WaveExists(integrals))
    Make/D/N=0 integrals
endif
Wave integrals
Variable numPoints = numpnts(integrals)
integrals[numPoints] = {integral}   // Add new point to integrals


After you have created the integrals wave you can display it in a table.

Quote:
My second problem is I want to remove the labels from my curve fit and "ModifyContour fit_w labels=0" does not remove them.


I'm not sure what the problem is. Your code should work if the string variable waveselection contains the name of the contour. You can use a Print statement to verify this.

Try it manually by choosing Graph->Modify Contour Appearance and selecting None from the Labels popup menu. This will show you the command you need.
hrodstein,
I tried using your code for appending values to table but I am getting an error message of "Inconsistent type for a wave reference" for the Make/D/N line.

Also I did figure out how to remove the labels from my curvefit.

Thanks for your help!
Quote:
I tried using your code for appending values to table but I am getting an error message of "Inconsistent type for a wave reference" for the Make/D/N line.


Igor is being excessively picky.

In the first Wave statement add /D after /Z. That will make it happy.