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
 automation of the same action on n 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

ajjbos

Netherlands
4 Posts

Posted - 10/14/2010 :  02:25:36 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear all,

I have a simple problem but no experience in programming.

I have a worksheet with n columns (n>100). Each column should be divided by the same fixed column. How can I automate this process?

Thanks in advance for any help.

Adrie
(Delft University of Technology)

Penn

China
644 Posts

Posted - 10/14/2010 :  03:36:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Adrie,

You can do that by using LabTalk script to loop all columns. For example, all columns except column one in the active worksheet will be divided by column one by running the following script. Here, the for loop is used.

// need to activate the worksheet first
for(int ii=2; ii<=wks.nCols; ii++)  // loop all columns
{
	// from column 2, all columns are divided by column 1
	wcol(ii) = wcol(ii)/wcol(1);
}


Penn
Go to Top of Page

ajjbos

Netherlands
4 Posts

Posted - 10/14/2010 :  04:38:02 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Penn.

Thanks very much. This is exactly I need.
Regards

Adrie



quote:
Originally posted by Penn

Hi Adrie,

You can do that by using LabTalk script to loop all columns. For example, all columns except column one in the active worksheet will be divided by column one by running the following script. Here, the for loop is used.

// need to activate the worksheet first
for(int ii=2; ii<=wks.nCols; ii++)  // loop all columns
{
	// from column 2, all columns are divided by column 1
	wcol(ii) = wcol(ii)/wcol(1);
}


Penn

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