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
 Saving fit parameters
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rrahul

USA
Posts

Posted - 07/19/2005 :  5:06:16 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.0
Operating System: Win XP

Hi,
I am fitting multiple data sets to Exp decay. I was hoping to save the fitting parameters from all the fits to a single file where each column will give me each of the parameters for fits performed.

I have included the code for reference.
Thanks,
Rahul



[Main]
FDLOG.multiopen.colview=12;
FDLOG.UseGroup(Ascii); //Open ASCII files
if (FDLOG.multiopen()==0/0)
return 1;

loop(ii,1,FDlog.MultiOpen.Count)
{
FDlog.Get(A, ii);
win -t data;
open -w %A;

%W= %H;

win -ch 1;

// wks.colsel(2,1);
run.section(, Plot, %W);
run.section(Fit,EXPDECAY1);

}


[Plot]


win -t plot Scatter G%W;
layer -i %W_b 0201 201;
layer -a;
layer.x.from = 0;
label -xb "Time(s)";
label -s -p 75 50 -n label1 G%W;
label1.fsize = 22; // change font size for label1

return 0;

Mike Buess

USA
3037 Posts

Posted - 07/19/2005 :  8:53:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The MultiFit add-on on the File Exchange should do what you want. Use the function mf2wks like this...

[Main]
FDLOG.multiopen.colview=12;
FDLOG.UseGroup(Ascii); //Open ASCII files
if (FDLOG.multiopen()==0/0)
return 1;

%O=FitParam; // name of parameter wks (MultiFit will create the wks)
loop(ii,1,FDlog.MultiOpen.Count)
{
FDlog.Get(A, ii);
win -t data;
open -w %A;

%W= %H;

win -ch 1;
// wks.colsel(2,1);
run.section(, Plot, %W);
run.section(Fit,EXPDECAY1);
mf2wks %O; // copy parameters to wks
}

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/20/2005 07:29:44 AM

Edited by - Mike Buess on 07/20/2005 10:29:09 AM
Go to Top of Page

rrahul

USA
Posts

Posted - 07/20/2005 :  12:38:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,
Thanks for the tip. But I can't seem to get the multifit add on to compile. It is giving compilation errors listed below:

compiling...
MultiFit.c
C:\Program Files\OriginLab\Origin7\OriginC\MultiFit.c(443) :Error, Variable "" not declared
C:\Program Files\OriginLab\Origin7\OriginC\MultiFit.c(443) :Error, general compile error
C:\Program Files\OriginLab\Origin7\OriginC\MultiFit.c(441) :Error, error(s) found in compiling function mfCreateOutputWks

Could I be doing something wrong? or is it a bug?
-rahul
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 07/20/2005 :  12:51:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Rahul,

Line 443 uses the LabTalk.object feature that was introduced in a service release. I don't remember which SR so I suggest you update to the latest... SR4.

...You can stop the compiler error with SR2 but I still recommend SR4.
http://www.originlab.com/index.aspx?s=9&ID=918&language=all&lm=144

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 07/20/2005 1:08:44 PM
Go to Top of Page

rrahul

USA
Posts

Posted - 07/20/2005 :  1:41:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,
With the SR4 version, Multifit complies and Labtalk code runs perfectly.
Thanks a lot for help.
-rahul
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