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
 Origin Forum
 Slope
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

protobion

India
Posts

Posted - 01/22/2005 :  03:00:32 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I am plotting Linear fits of data. I cannot find an option that allows me to get the slope of the linear plot.
Anyhelp here please?
Er, no Labview available.

Edited by - protobion on 01/22/2005 03:09:01 AM

Mike Buess

USA
3037 Posts

Posted - 01/22/2005 :  07:40:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The Analysis->Fit Linear and Tools->Linear Fit menu commands print slope and intercept to the results log. Use the stat object to obtain those values programmatically.

>>Er, no Labview available.

That's OK. LabView is not required.

...You can add a text label to your graph showing the slope and intercept as follows.

1. With graph active run Analysis->Fit Linear.
2. Enter this LabTalk command in the script window...

label -s -sa "slope=$(stat.lr.b)\nintercept=$(stat.lr.a)";

That will create a text label that looks like this...

slope=<value of slope>
intercept=<value of intercept>

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/22/2005 12:07:28 PM
Go to Top of Page

protobion

India
Posts

Posted - 01/23/2005 :  02:23:03 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot Mike. I can now do exactly what I wanted to. Is there any way to turn this into a convenient button?
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/23/2005 :  06:00:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Open Custom.ogs in notepad and replace the script under the [Main] section with your script. That section is run by the Custom Routine button on Origin's standard toolbar.

Mike Buess
Origin WebRing Member
Go to Top of Page

protobion

India
Posts

Posted - 01/23/2005 :  08:18:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks again. I see how this button-script relation works now.
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