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
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.