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
 NLSF doesn't consider the borders

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
Malab Posted - 04/05/2006 : 03:19:26 AM
Hi,
if I try the following code, the border (myvarstart and myvarend) will not be considered. It takes always the whole dataset! I can not find a mistake. Maybe the order of the commands?

Thank you for help


nslf.begin();
nlsf.init();
nlsf.cleanupfitdata();
nlsf.func$="lorentz";
nlsf.numreplica=0;
nlsf.pastetoplot=1;
nlsf.datastep=1;
nlsf.pastetoplot=1;

nlsf.databegin=MyVarStart;
nlsf.dataend=MyVarEnd;
nlsf.fitdata$=inp$(wksi)_Y$(i);


nlsf.p1=0;
iii=1;
nlsf.p$(iii)=MyVarCenter$(iPeak); //some Var
iii++;
nlsf.p$(iii)=MyVarWidth$(iPeak); //some Var
iii++;
nlsf.p$(iii)=29000;


nlsf.iterate(Iter);
nlsf.iterate(Iter);
nlsf.iterate(Iter);

nlsf.end();



Origin Version: 6.0G
Operating System: Win2000
2   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 04/06/2006 : 3:59:48 PM
It appears that nlsf.fitdata$ must be defined before nlsf.databegin|dataend in 6.0. This will fit over the desired range and create a fit curve for the same range. (Leaving out the nlsf.xBegin|xEnd|xMode commands will perform the proper fit but create a curve over the full range.)

%P=inp$(wksi)_Y$(i);
%A=xof(%P);
nslf.begin();
nlsf.init();
nlsf.cleanupfitdata();
nlsf.func$="lorentz";
nlsf.numreplica=0;
nlsf.pastetoplot=1;
nlsf.datastep=1;
nlsf.pastetoplot=1;

nlsf.fitdata$=%P;
nlsf.databegin=MyVarStart;
nlsf.dataend=MyVarEnd;
nlsf.xBegin=%A[MyVarStart];
nlsf.xEnd=%A[MyVarEnd];
nlsf.xMode=1;

nlsf.p1=0;
iii=1;
iii++; // next parameter is p2!
nlsf.p$(iii)=MyVarCenter$(iPeak); //some Var
iii++;
nlsf.p$(iii)=MyVarWidth$(iPeak); //some Var
iii++;
nlsf.p$(iii)=29000;

nlsf.iterate(Iter);
nlsf.iterate(Iter);
nlsf.iterate(Iter);

nlsf.end();

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 04/06/2006 4:18:26 PM
easwar Posted - 04/06/2006 : 09:21:28 AM
Hi Malab,

The properties you were using, nlsf.databegin, and nlsf.dataend are the correct ones, if what you are trying to do is to restrict the fit to a certain range of the data.

Note that these properties refer to the row number and not the x values - perhaps that was the problem?

I tried your script (with some lorentz data and some fixed values for parameters instead of your variables) and it worked fine in 7.5.

Easwar
OriginLab


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