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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 NLSF doesn't consider the borders
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Malab

Germany
19 Posts

Posted - 04/05/2006 :  03:19:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

easwar

USA
1965 Posts

Posted - 04/06/2006 :  09:21:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 04/06/2006 :  3:59:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000