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
 dividing workbook 1 with workbook 2, column wise

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
nns2006 Posted - 04/09/2015 : 07:08:58 AM
Origin Pro Ver.8.5.0 SR1 b161 and Service Release (Select Help-->About Origin):
Operating System:W7

Hello,
I have two workbooks with multiple columns of type XYYYYY.., named reference and sample respectively.
I want to divide the data of column in sample book with corresponding column in reference book.
for example column A, row 3 in sample is divided by column A, row 3 in reference and so on.
How can I do that? Please see the pictures.
Nitya
4   L A T E S T    R E P L I E S    (Newest First)
SeanMao Posted - 04/20/2015 : 04:16:51 AM
Hi,

You may try to run the following LabTalk command:


	int colnum = wks.ncols; // Number of columns for calculation
	for ( ii = 1; ii <= colnum; ii++)
	{
		vmathtool -r 2 ix1:=[Sample]Sheet1!wcol(ii) operator:=div operand:=data ix2:=[Reference]Sheet1!wcol(ii) ox:=[Results]<active>!<new>;
		// Sample, Reference are the workbook short names, Results is the destination workbook for results
	}


Regards!

Sean

OriginLab Tech. Service
nns2006 Posted - 04/17/2015 : 05:59:47 AM
Can there be any script which I can run to complete this process at once?

Thanks
nns2006 Posted - 04/09/2015 : 12:34:11 PM
quote:
Originally posted by lkb0221

Hi,

For LT, simply loop through all columns and do calculations one by one.

For GUI method, convert both wks directly into two matrixes in the same Mbook, divide one by the other, then convert the result matrix back to wks.

OriginLab
Zheng


I was able to create Mbook for both sheets separately and then I copied the reference Mbook data and put into the Mbook for Sample in Msheet2. But I don't get the option to divide Msheet1 by Msheet2. Am I doing it correctly or its wrong? I am not so familiar with Origin. Can you break down the steps please.
Thank you.
lkb0221 Posted - 04/09/2015 : 10:10:44 AM
Hi,

For LT, simply loop through all columns and do calculations one by one.

For GUI method, convert both wks directly into two matrixes in the same Mbook, divide one by the other, then convert the result matrix back to wks.

OriginLab
Zheng

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