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

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
ajjbos Posted - 10/14/2010 : 02:25:36 AM
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)
2   L A T E S T    R E P L I E S    (Newest First)
ajjbos Posted - 10/14/2010 : 04:38:02 AM
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

Penn Posted - 10/14/2010 : 03:36:01 AM
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

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