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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Nonlinear fit returns error

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Garchinski Posted - 02/18/2014 : 04:06:54 AM
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
1   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 02/18/2014 : 11:00:21 AM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000