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
 Using GUI.InputData to set X-Errors/Y-Errors

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
ScriptQuestions Posted - 03/03/2022 : 12:34:33 PM
Version: OriginPro 2020b (Academic);

Hello,

I am trying to automate non-linear fitting with Orthogonal Distance Regression, as my data has both X and Y errors. My current code is taken from another forum post here, and was the first solution to allow me to change the fitting algorithm by script. This is my current code:

tree nlGUI;
xop execute:=init classname:=FitNL iotrgui:=nlGUI;

//Specify function and input data, then update operation tree before fitting.

nlGUI.GUI.FunctionSelection.FunctionList$="Allometric1";


nlGUI.GUI.FunctionSelection.fitmethod=2; //Use ODR




nlGUI.GUI.InputData.Range1.X$=Col(A);



nlGUI.GUI.InputData.Range1.Y$=Col(C);




xop execute:=update iotrgui:=nlGUI;

xop execute:=report iotrgui:=nlGUI;

//Clean up operation objects after fit

xop execute:=cleanup;


My error data is in Col(B) for the X error, and in Col(D) for the Y error. What is the right syntax to enter this data into my InputData?
Or, in other words, where in the tree do I put the Error data?




This is how the GUI would look like if the data input was made by hand. The range1.X$ value has a sub-branch, which i would like to access via script to fill in my error values, but I do not know the correct syntax. Any help would be much appreciated.
2   L A T E S T    R E P L I E S    (Newest First)
ScriptQuestions Posted - 03/04/2022 : 08:50:10 AM
Thank you for this solution, after updating to 2022 it works like a charm, as it did not work for 2020b.

Thank you very much!
minimax Posted - 03/04/2022 : 04:50:20 AM
Hi ScriptQuestions,

Note: 2020b does not support the script below very well yet.
You may try upgrading to latest version to take a try?

Please try using XF nlbegino:
https://www.originlab.com/doc/en/X-Function/ref/nlbegino

//Start the implicit fit with instrumental error, column 4 is the y error and column 2 is the x error.
nlbegino iy:=(1,3,4,2) func:=Allometric1 weight:=1;
nlfit;
nlend 1 1;

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