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
 Averaging Worksheets

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
tonyv Posted - 09/29/2006 : 08:39:49 AM
Hi,

Could you tell me how to average Worksheets in a program?

Thank you

3   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 09/30/2006 : 08:28:40 AM
Hi Tony,

If you are asking how to create a worksheet with columns that are the averages of corresponding columns in existing worksheets then the following LabTalk script will average all worksheets in the active project folder. Of course existing worksheets must all have the same number of columns and rows.

%P=%H; // save name of active wks
wo -d; // duplicate active wks
%W=%H; // save name of new wks
ncols=wks.ncols; // number of columns
nn=1;
doc -ef W {
if("%H"!="%W" && "%H"!="%P") {
loop(i,1,ncols) {%(%W,i) += %(%H,i)};
nn++; // count worksheets
};
};
loop(i,1,ncols) {%(%W,i) /= nn};

...An OriginC version of the operation is given near the end of this topic.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 09/30/2006 08:59:46 AM
zachary_origin Posted - 09/30/2006 : 04:13:17 AM
Hi Tonya,

Do you mean you want to program to do the average? Do you really need average the whole worksheet? In Origin, there is no direct averaging method for the whole worksheet because by design the data in different columns worksheet have different designation, saying X,Y, so that it is not reasonable to average them. For each column (dataset), you can use Average script in LabTalk and Datasum function in OriginC to average the data. If the data are stored in a matrix, matrixbase::GetMean method can be used. You can search these keywords in Origin:Programming.

Zachary
OriginLab Technical Services.


Edited by - zachary_origin on 09/30/2006 04:35:36 AM
erica-cn Posted - 09/30/2006 : 02:51:58 AM
hi Tonya Vitova

I am sorry that don't know what you really want to do. Would you please tell me what you mean about "average Worksheets in a program "
Thank you

Erica Shang
OriginLab Technical support


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