Hi Kwan,
You can use the nlbegin, nlfit, and nlend X-Functions to do that. However, when you specify the fitting data range, you need to use the data index, but not the X values. The following is a simple example:
fname$=system.path.program$ + "Samples\Curve Fitting\Multiple Peaks.dat"; // prepare data
newbook; // create a new workbook
impasc; // import the data
plotxy (1, 2); // plot column b
range rr = layer1!plot(1); // get plot 1
for(ii=1; ii<=90; ii+=30)
{
nlbegin iy:=rr[ii:ii+30] func:=gauss nltree:=ParamTree; // begin fitting, data index from ii to ii+30
nlfit; // fitting
type Baseline y0 is $(ParamTree.y0),; // type the fitted parameters
type Peak Center is $(ParamTree.xc), and;
type Peak width (FWHM) is $(ParamTree.w);
nlend; // end fitting
}
You can refer to this page for more details on fitting by using LabTalk. And more examples are here.
By the way, you can use the Quick Fit Gadget to fit part of your data in the graph easily.
Penn