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 last 20 points in several 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
AOjuva Posted - 04/27/2022 : 01:20:04 AM
Origin Ver. and Service Release (Select Help-->About Origin): 2022 SR1
Operating System: Win 11

Hi, I have multiple Y columns with varying lenghts (separated series from a long measurement). Usually I have to manually check the values and mask some of the points at the end, where the measurement value is erraneous (e.g. sensor in air between samples), and then I choose the last ~20 points, average them and get a single data point from that sample.

The masking will have to be done by hand, but is there an easy way to select the last ~20 points using cell formula? I can also delete the erraneous points instead of masking them, if it is needed.
4   L A T E S T    R E P L I E S    (Newest First)
AOjuva Posted - 04/27/2022 : 04:53:04 AM
Thanks, that works when I delete the obsolete data at the end first. :)

AmandaLu Posted - 04/27/2022 : 04:45:14 AM
Hi,

If you want to keep last 20 rows, please try:

doc -e DY{
range rcol = %c;
int nn = rcol.nrows;
range rr = rcol[1:$(nn-20)];
del rr;
}

Thanks,
Amanda
OriginLab Technical Service
AOjuva Posted - 04/27/2022 : 02:39:04 AM
Hi,

Sorry for being unclear. I need those last 20 cells, after I have masked the tail, for my analysis. See an example attached. :)

AmandaLu Posted - 04/27/2022 : 02:31:49 AM
Hi,

Please run following script in the Command Window:

doc -e DY{
range rcol = %c;
int nn = rcol.nrows;
range rr = rcol[$(nn-19):$(nn)];
del rr;
}

This will delete the last 20 rows for each Y column in the current worksheet.

Thanks,
Amanda
OriginLab Technical Service


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