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
 nlfs script not working in 7.5
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

deanx

UK
Posts

Posted - 09/14/2004 :  11:52:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Mike Buess

USA
3037 Posts

Posted - 09/14/2004 :  12:46:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

deanx

UK
Posts

Posted - 09/15/2004 :  06:49:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike,

It all works again now.
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