Author |
Topic |
|
Belsinga
Netherlands
28 Posts |
Posted - 06/08/2010 : 03:03:24 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): 8 SR 6 Operating System: Win Xp
Hello,
I can not seem to get my simple fitting-script to work. Can anyone help? (he doesnt seem to understand my dataset or something?
regards, Boudewijn
***************** dataset DS1=col(Q9);
LR -b DS1
type "Slope is $(lr.b)"; type "Quality is $(lr.r)"; |
|
Belsinga
Netherlands
28 Posts |
Posted - 06/08/2010 : 03:14:18 AM
|
Obviously, the ";" was missing, but that was not the problem
***************** dataset DS1=col(Q9);
LR -b DS1;
type "Slope is $(lr.b)"; type "Quality is $(lr.r)"; [/quote] |
|
|
larry_lan
China
Posts |
Posted - 06/08/2010 : 04:47:00 AM
|
Hi:
Did you see any Error Message? We tried and the script have no problem. If the issue still exist, maybe you can send us your OPJ and we can try again.
Thanks Larry OriginLab Technical Services |
|
|
Belsinga
Netherlands
28 Posts |
Posted - 06/10/2010 : 08:02:33 AM
|
Hi,
I get no apparent errors.
The code doesn't seem to get to "TST2" (when I removed the '=' sign in "dataset DS=col(Q9)", the errors dissapeared).
***************************** type "TST1";
dataset DS col(Q9);
type "TST2";
LR -b DS [0,50]; //lr.maxLRange = 50;
type "Slope is $(lr.b)"; type "Quality is $(lr.r)";
|
|
|
larry_lan
China
Posts |
Posted - 06/10/2010 : 10:45:39 PM
|
Hi:
It's weird. dataset DS col(Q9) (no '=' sign) is invalid and should return error in 8.0 SR6. How about the following script:
newbook; col(a) = data(1, 30); dataset ds = col(a); stats ds; ty "The sum of column a is $(stats.sum)!";
Thanks Larry |
|
|
Belsinga
Netherlands
28 Posts |
Posted - 06/11/2010 : 03:40:40 AM
|
Thank you,
This one works, but I don't understand why it only works with "newbook;" Can't you call on existing workbooks?
Secondly, I am now working with non linear fits. I would like to edit the x-range of the fitted curve and I tried the following, but somehow it still fits the entire curve, could you comment on that?
Thanks
/******************/
nlsf.func$ = Allometric1; a=1; b=1; nlsf.cleanupfitdata(); nlsf.numfitsets = 1; nlsf.fitdata$ = Book5_F; double Vxmin = 0.02; double Vxmax = 0.03; nlsf.xBegin = Vxmin; nlsf.xEnd = Vxmax;
// WHY DOESNT IT CHANGE ACCORDINGLY IN THE PLOT? type $(Vxmin); type $(Vxmax); //nlsf.xPoints = 201; nlsf.fit(100); nlsf.funcx$ = Book5_A; nlsf.funccol$ = Book5_R1; nlsf.makecurve(func);
|
|
|
Belsinga
Netherlands
28 Posts |
Posted - 06/11/2010 : 05:44:30 AM
|
Never mind, I allready found it:
it should be "slsf.dataBegin"
Regards, |
|
|
larry_lan
China
Posts |
Posted - 06/11/2010 : 08:46:42 AM
|
Hi:
I doubt you didn't active the worksheet that contains Q9. When using dataset ds=col(Q9), it will refer to the Active Worksheet. Or, you should specify the full data range.
Now that you are using Origin 8, I suggest you can use our new X-Functions to do nonlinear fitting. Please search nlbegin in the programming help. There are examples for how to use these X-Functions. And you can specify a range to fit part of the curve.
Thanks Larry |
|
|
|
Topic |
|