| T O P I C R E V I E W |
| deanx |
Posted - 09/14/2004 : 11:52:07 AM Origin Version : 7.5 sr4 Operating System: WinXP
I have a labtalk script which fits a gauss curve to all colums in a worksheet (spectra) then saves one parameter and the error to a second work sheet (output). The script is as follows:
for (test=2; test<=%(SPECTRA,@#); test++){ %A=SPECTRA!wks.col$(test).label$; output_ps[test-1]="%A"; nlsf.begin(); nlsf.func$="gauss"; nlsf.setDepend(y,%(SPECTRA,test)); nlsf.x$="SPECTRA_A"; nlsf.constr$=""; nlsf.p1=4025; nlsf.p2=429; nlsf.p3=6.8; nlsf.p4=40618; nlsf.tolerance=0; nlsf.fit(150); output_peak[test-1]=nlsf.p2; output_error[test-1]=nlsf.e2; nlsf.end(); }
In V7 this woks perfectly in 7.5 it doesn't work at all. It appears as though the data is not been set in the nlsf object so the fit doesn't do anything or fits to the last manual fit that had been performed. So I would guess that the line
nlsf.setDepend(y,%(SPECTRA,test));
isn't doing what it used to. Either a solution or just a nicer way to do this would be good.
Thanks
|
| 2 L A T E S T R E P L I E S (Newest First) |
| deanx |
Posted - 09/15/2004 : 06:49:57 AM Thanks Mike,
It all works again now. |
| Mike Buess |
Posted - 09/14/2004 : 12:46:17 PM I would normally use this to set the dependent dataset (I assume the column number is test)...
%A=%(SPECTRA, @D, test); nlsf.y1$=%A; -or- nlsf.fitdata1$=%A;
Works in all versions.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 09/14/2004 12:51:09 PM |
|
|