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

Garchinski

Germany
1 Posts

Posted - 02/18/2014 :  04:06:54 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 8.5
Operating System: Win 7

Hello,
I try to do a nonlinear fit using SineSqr

My code looks like this:

fname$= "C:\data\Scan.dat";
newbook;
impasc;
string bkname$=%H;
int col_num = wks.ncols;
range wksObject = [bkname$]1!;

for (ii=3; ii<= col_num; ii++)
{
wksObject.addcol();
string strData$ = %(wksObject.ncols);
range fitx=1, fity=3;
plotxy iy:= [bkname$]1!wcol(ii) ogl:=!1 color:=ii plot:=200;
nlbegin iy:= [bkname$]1!wcol(ii) func:=SineSqr nltree:=tt;
nlfit;
fity=fit(fitx);
nlend;
}

During the first run this code returns the following error message:

general operation failure
Internal error code: -898, -28673

As I am totally new to LabView Scripting, I have no clue what the cause might be. (And what exactly "fity=fit(fitx);" is needed for, I took this part from an example code).

Does anybody see what bug(s) could cause the error message?
Thanks for your help!
Garchinski

lkb0221

China
497 Posts

Posted - 02/18/2014 :  11:00:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

After reading your code, I'm a little confused about what you want to do...
And actually, I cannot reproduce the error massage.

Can you provide a little more detailed description?

"Fit" function creates a dataset corresponding to the fitted line generated during nonlinear fitting.

Followings are some web pages that might help you to learn curve fitting by LabTalk:
http://www.originlab.com/doc/LabTalk/guide/Non-linear-Fitting
http://www.originlab.com/doc/LabTalk/examples/Curve-Fitting
http://www.originlab.com/doc/LabTalk/ref/Fit-func

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