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
 specifying >1 independent variables in Labtalk
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nevinlambert

USA
Posts

Posted - 08/24/2005 :  10:11:13 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: XP

Hello:

I want to perform 2d gaussian fitting using my own function on a series of datasets (up to 20) and have written (actually corrupted an example script) a test script to automate this tast, starting with only 2 datasets (data1 and data2). Everything seems to work OK except that the 2nd independent variable doesn't get specified- I was using nlsf.setIndep to do this, but it doesn't seem to work? Can this method be used to specify >1 independent variable in a dataset?

I suspect I could speed up this task by writing code in Origin C, but my programming skill falls a little short of that at the moment.....thanks.

The script I'm trying is:

// Set up the fit //

nlsf.func$ = gaussian2doffset; // select fitting function

nlsf.numfitsets = 2; // indicate 2 datasets to be fitted

nlsf.numDepend = 1;
nlsf.numIndep = 2;

nlsf.fitdata1$ = data1_c; // define 1st dataset to be fitted

nlsf.setDepend(z(1),data1_c);
nlsf.setIndep(x(1),data1_a);
nlsf.setIndep(y(1),data1_b);


nlsf.fitdata2$ = data2_c; // define 2nd dataset to be fitted

nlsf.setDepend(z(2),data2_c);
nlsf.setIndep(x(2),data2_a);
nlsf.setIndep(y(2),data2_b);

// Initialize parameter set for data1 //

nlsf.p1 = 100;
nlsf.p2 = 5;
nlsf.p3 = 0.2;
nlsf.p4 = 5;
nlsf.p5 = 0.2;
nlsf.p6 = 10;

// Initialize parameter set for data2 //

nlsf.p7 = 100;
nlsf.p8 = 5;
nlsf.p9 = 0.2;
nlsf.p10 = 5;
nlsf.p11 = 0.2;
nlsf.p12 = 10;

// Perform the fit //

nlsf.fit(1); // iterate 1 time

DrKlein1

Germany
6 Posts

Posted - 07/29/2010 :  11:28:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I have very much the same problem only that I am using Origin 6.1 and Windows XP as operating system
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