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
 gauss 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
Flavs Posted - 09/15/2006 : 1:13:04 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System:xp sp2

Hi, I have made a script to do a gauss fit. I made it mainly coping other scripts from the forum, so maybe is not the best piece of code. But the code seems to work properly for me.

I want to change the two following things , after the code executes it creates a window with the fitting data, I want to avoid this!!! I only nead the peak of the curve an I alredy write this on a variable at the end of the code.
Second thing I want to change, I donīt want to give initial values to the parameters of the fitting, when you do a gauss fit using the origin interface (Analysis:: FitGaussian) you donīt need to specify any values, so why do I have to initialize the parameters when I execute my script. If I donīt initialize the parameters the code doesnīt work.

my script

[main]
rango1=%1; // data begin
rango2=%2; // data end
campo=%3; // field (dataset name)
tem=%4; // temperature (dataset name)

nlsf.init(); // initialize fit
nlsf.dataBegin=rango1; // begin range
nlsf.dataEnd=rango2; // end range
nlsf.func$="Gauss"; // define function to be used during fitting
nlsf.constr$=""; // clean ???
nlsf.fitData$=h$(campo)t$(tem)_re; // define data to be fitted
nlsf.funcX$=h$(campo)t$(tem)_an;// X data to be used to create fit dataset

nlsf.p1= 2; // initialize parameters
nlsf.p2=260;
nlsf.p3=30;
nlsf.p4=10;
nlsf.iterate(150); // perform 150 iterations

pico=nlsf.p2; // write xc in pico variable
nlsf.end();
4   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 09/18/2006 : 08:15:42 AM
Use nlsf.end(1) instead of nlsf.end().

Mike Buess
Origin WebRing Member
Flavs Posted - 09/18/2006 : 04:05:37 AM
Hi, Itīs me again, everything works fine. But I want to modify a detail, I donīt want the plot of the curve fitting in my graph, how do I change this detail?.

Thanks.
Flavs Posted - 09/16/2006 : 4:26:32 PM
Thanks !!! you are really helpful.
Mike Buess Posted - 09/15/2006 : 2:49:18 PM
1> Insert nlsf.output(0); before nlsf.iterate(150); to avoid the graph window.

2> Analysis::FitGaussian initializes the parameters automatically. You can do the same by replacing nlsf.p1=2; nlsf.p2=260; nlsf.p3=30; nlsf.p4=10; with nlsf.execute("paranint");.

Mike Buess
Origin WebRing Member

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