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
 Fitting data by clicking a button

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
Stéphane Posted - 06/06/2007 : 04:19:38 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: xp

Hi!

I have datas in a graph and want to fit them by clicking on a button on the graph, so that the fitted datas will be saved in an existant worksheet and not in a new "polyfitxxx-worksheet". How may I write this in the "Label control" of the button? The goal is that the following of the programm works (links on worksheets) without that the user has to rename the created fits. Is it possible to use/call the NLSF-tool in that way?

Thanks for your help!
Stéphane
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 06/06/2007 : 11:27:46 AM
Hi Stephane,

quote:
Is it possible to use/call the NLSF-tool in that way?
Yes it is, but it sounds like you've been using Analysis > Fit Polynomial which uses the STAT object rather than NLSF. Seems like it would be much easier to save your curve fits to separate PolyFitn worksheets as you have been doing and then collect all PolyFit worksheets to a single results worksheet. That can be done by assigning the following script to the Custom Routine button as described here.

%A="";
if( exist(PRWks$,4) ) %A=PRWks$;
getn ( ) %%A (Enter name of results worksheet);
if( !exist(%A,2) ) {
win -n W %A;
PRWks$ = %A;
};
win -a %A;
wks.joinmode=0;
doc -e W {
if("%[%H,8]"=="PolyFit") {
%A!wks.join(%H);
win -cd %H;
};
};

If you really want to program the whole process look at the [FitPolynomial] section of PR.OGS which runs when you select Fit Polynomial. See also the example in the Programming Guide (Help: Programming: LabTalk Language Reference: Object Reference: Alphabetical List of Objects: Stat).

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/06/2007 12:01:33 PM

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