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
 X data points in linear fit

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
akruse Posted - 07/31/2018 : 5:08:09 PM
Origin Ver. and Service Release (Select Help-->About Origin): Student 2018
Operating System: Windows 7

I'm writing a code to perform a linear fit using the xop code (because it displays the data the way I need at the end) similar to how it's shown here: https://www.originlab.com/doc/X-Function/ref/xop

I would like a line of code to change the number of points in the X data. Manually, we would do that here:


I would like to change this value to a number I have saved in ww.

Alternatively , if anyone has a way to use the simple LabTalk code for linear fit and still display the two data sheets the dialog box does, that would be helpful too.
2   L A T E S T    R E P L I E S    (Newest First)
akruse Posted - 08/01/2018 : 10:53:17 AM
That didn't quite work, but it led me to what I needed so thanks for the reply!

For the future readers with the same problem, this is the code I used:

tree lrGUI;
xop execute:=init classname:=FitLinear iotrgui:=lrGUI;
lrGUI.GUI.InputData.Range1.X$ = col(1);
lrGUI.GUI.InputData.Range1.Y$ = col(10);
lrGUI.GUI.Graph1.XDataType.N=ww;
xop execute:=report iotrgui:=lrGUI;
xop execute:=cleanup;

Cheers!
yuki_wu Posted - 07/31/2018 : 11:14:16 PM
Hi,

After create the GUI tree:
tree lrGUI;
xop execute:=init classname:=FitLinear iotrgui:=lrGUI;

You could output the GUI tree by:
lrGUI.=

Then, you could find:
lrGUI.Graph1.XDataType.N=1000;

Also, you could use fitLR to perform simple linear fitting:
https://www.originlab.com/doc/X-Function/ref/fitLR

Regards,
Yuki

OriginLab

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