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
 Forum for Origin C
 nlsf - vn and pn in OriginC

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
Volker Posted - 06/25/2002 : 02:46:39 AM
Hi,
is there any possibility to set or read the nlsf.vn and nlsf.pn parameters from within OriginC? I tried to change them by using _LT_Obj, but it won't change anything. Also, control.Par[n] won't work either. I have to set the initial values for my (user-defined) fitfunc, and set some parameters fixed in the beginning, and make them variable after some Iterations to have good initial values.
1   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 06/25/2002 : 09:15:46 AM
Hi,

As long as you follow the proper LabTalk syntax, the commands should work fine inside the _LT_Obj block in Origin C.

Try the following for example:

void fit(string strDataName)
{
_LT_Obj
{
NLSF.INIT;
NLSF.FUNC$ = "gauss";
NLSF.FITDATA$ = strDataName;
NLSF.P1 = 10;
NLSF.P2 = 20;
NLSF.P3 = 4;
NLSF.P4 = 90;
NLSF.V2 = 0; // fix 2nd parameter
NLSF.CONTROL("FIT"); // bring up dialog with fit page
}
}

Here, the parameter values for the "gauss" function are set, the second parameter is set as fixed, and then the NLSF dialog with the fit page is brought up.

To test the above code, open a new worksheet, fill colA with row numbers, set colB values with the formula:
gauss(col(a),10,20,5,100)+ran()
Make a plot of colB, and then type the following in the script window and hit return:
fit %c

Note that you can also have code like:

int ii = 2;
NLSF.P$(ii) = 20;

Easwar
OriginLab.


Edited by - easwar on 06/25/2002 09:23:23

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