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
 Find maximum in a column, delete following data

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
Thymes Posted - 10/19/2012 : 02:55:06 AM
Hello everyone,

I hope someone is able to help me.

I have 6 columns displaying force data. Now, what I would like to do is find the maximum value within each column and delete all following data points. But I want to keep the data before the maximum is reached.
Any help would be great!

Thymes


Origin Ver. and Service Release: OriginPro 8.5.0 G SR1
Operating System: Win 7
2   L A T E S T    R E P L I E S    (Newest First)
Thymes Posted - 10/22/2012 : 03:10:54 AM
Thank you!

Your script works perfect
This is really a big help!

More thanks and greetings from Germany
Thymes
greg Posted - 10/19/2012 : 11:43:58 AM
The following script takes into account that there may be repeat maximums and uses the last maximum:

loop(ii,1,wks.ncols)
{
range ra = $(ii);
dataset ds;
stats ra;
vfind ix:=ra value:=stats.max ox:=ds;
ra.SetSize(ds[ds.GetSize()]);
}
doc -uw;

If you only want the first, then use this:
loop(ii,1,wks.ncols)
{
range ra = $(ii);
dataset ds;
stats ra;
vfind ix:=ra value:=stats.max ox:=ds;
ra.SetSize(ds[1]);
}
doc -uw;

In the GUI, this amounts to using statistics on columns to find the maximum value, then using Edit : Find to locate the maximum and selecting and deleting all following rows.

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