| 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
|