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
 Subtract reference data from several columns
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

q-vector

4 Posts

Posted - 06/20/2019 :  09:40:11 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2016 (64-bit) Sr2 b9.3.2.303
Operating System: Windows 2012 Server

Hi,

I would like to subtract reference data from each column starting with column 20 until 163. I want to solve this by using labtalk with this script:

j=20;
for (j)
{ subtract_ref -r 2 iy1:=[Book1]D0000228!(A,j) iy2:=[Book1]D0000228!(AC1,AE"empty_cell*2.98") common:=1 oy:=<new>;
j = j + 1;
if (j > 163) break;

};

What is wrong here? Is it possible by using the subtract_ref function?

Thank's for your help!

best q-vector

yuki_wu

896 Posts

Posted - 06/20/2019 :  10:49:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

1. Use the for command correctly or use loop command instead.
https://www.originlab.com/doc/LabTalk/ref/For-cmd
https://www.originlab.com/doc/LabTalk/ref/Loop-cmd

2. Correct the range string to make it represent the range object you desired to access.

For example, to subtract the dataset of col(E) and col(F) from column(B) to column(D) with column(A) as X:

loop(ii, 2, 4)
{
subtract_ref -r 2 iy1:=[Book1]Sheet1!(1,%(ii)) iy2:=[Book1]Sheet1!(E,F) common:=1 oy:=<new>;
};


Hope it helps.

Regards,
Yuki
OriginLab
Go to Top of Page

q-vector

4 Posts

Posted - 06/21/2019 :  08:07:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you, Yuki that helped a lot.
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