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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 X data points in linear fit
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

akruse

USA
2 Posts

Posted - 07/31/2018 :  5:08:09 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Edited by - akruse on 07/31/2018 6:44:14 PM

yuki_wu

896 Posts

Posted - 07/31/2018 :  11:14:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - yuki_wu on 07/31/2018 11:19:00 PM
Go to Top of Page

akruse

USA
2 Posts

Posted - 08/01/2018 :  10:53:17 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000