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