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
 dividing workbook 1 with workbook 2, column wise
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nns2006

Austria
3 Posts

Posted - 04/09/2015 :  07:08:58 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

lkb0221

China
497 Posts

Posted - 04/09/2015 :  10:10:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

nns2006

Austria
3 Posts

Posted - 04/09/2015 :  12:34:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

nns2006

Austria
3 Posts

Posted - 04/17/2015 :  05:59:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can there be any script which I can run to complete this process at once?

Thanks
Go to Top of Page

SeanMao

China
288 Posts

Posted - 04/20/2015 :  04:16:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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