The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Gaussian fit

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
chunkwan Posted - 06/27/2011 : 08:34:17 AM
I am trying to do a gaussian fit on my graph but I don't really know how to do it in terms of labtalk code. I am trying to cut my graph into few sections and do a fit on each section, like x value of 1-10,11-20. What are the codes for Gaussian fit if I want to cut it into few sections? And can someone explain it to me? Thanks.

Kwan
1   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 06/28/2011 : 01:58:42 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000