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
 subtract straight line command

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
moondream Posted - 05/27/2002 : 04:27:37 AM
Hi,
I want to integrate a peak with an inclined baseline, but I could not find direct menu in origin 6.0, so I think the command "substract straight line" under analysis menu may be useful, while I am quite confused about the script for this command, is there someone can explain the following script for me, how does it work? and is there a simple script can integrate a peak with inclined baseline?

#Pick two screen pts and subtract %C from the line formed
create _line -M 3;set _line -l 1;
def EndToolbox (;undo %C;%C --O _Line;del _line;rescale);
GetPts -n _line 2
[Double-click to set straight line begin..]
[Double-click to set straight line end..];


thanks alot
moondream
5   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 12/25/2017 : 03:45:25 AM
Hi Markus,

You can try the X-Function subtract_ref, for example:

// Subtracts XY pair in cols 3&4 from XY pair in 1&2 and puts subtracted XY pair in cols 5&6.
subtract_ref iy1:=[Book1]Sheet1!(1,2) iy2:=[Book1]Sheet1!(3,4) oy:=[Book1]Sheet1!(5,6)

More info please find here:
https://www.originlab.com/doc/X-Function/ref/subtract_ref

Regards,
Yuki
OriginLab
MarkusSt Posted - 12/23/2017 : 09:29:01 AM
Hi,

it works, but I would need to save the subtracted data in a new row in the worksheet, and leave the original data unchanged.

How can i do that?

Thx,
Markus
Jose Posted - 05/27/2002 : 11:25:41 AM
All I've explained above was taken from the LabTalk help file that comes with the program. Go to the Search tab and type the command or macro names above to get information about them.

Good to hear that it was useful


Jose Viņa, Origin WebRing member
moondream Posted - 05/27/2002 : 09:31:08 AM
Jose, Thank you very much.
your explanation is perfect!
while where can I get these informations as you explained. I can not find much more in help file.

cheers,
moondream
Jose Posted - 05/27/2002 : 05:49:39 AM
create _line -M 3;set _line -l 1;


This creates a new dataset named _line and its associated X dataset _line_A, with 3 rows. Then sets its line connection type to 'line'.

def EndToolbox (;undo %C;%C --O _Line;del _line;rescale);


This defines a special macro, 'EndToolbox', that is to be run AFTER you select the two points that determine your substracting line in the next step. Inside this macro you find four commands:

1. Creates a backup of the current dataset so you can 'undo' later if you want.
2. Substracts your _line dataset from your currently selected data (%C).
3. Deletes the _line dataset.
4. Rescales the graph to show all data.

GetPts -n _line 2
[Double-click to set straight line begin..]
[Double-click to set straight line end..];

This asks you to select two XY points in the graph that are going to be kept in the _line dataset. The Screen Reader tool is activated to allow you to do it. After you do that, the Screen Reader tool is de-selected and the 'EndToolbox' macro is triggered, making the substraction.

The substraction in step 2 above is done with interpolation inside and outside (-O) the range you have selected, so your two selected points are enough to define a straight line to do that operation.


Jose Viņa, Origin WebRing member

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