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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Statistics: Max and Min
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

abreiti

Germany
Posts

Posted - 08/06/2008 :  09:35:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello forum,

I'm looking for a max-min-function like the "ave"-function. I've a column that should be separated in five equal araes. Now I need the min and max-value of every arae.

Anyone has an idea?

abreiti



adamleewiner

China
Posts

Posted - 08/06/2008 :  7:55:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, I have a way.
Assuming that this colume is col(A),and the number of elements in this column is a multiple of 5.

dataset data=col(a);
nums=data.getsize();//get the size of the column.Or use 'nums=wks.ncol$(colnum(a)).nrows'(SR1)
nsize=nums/5;//area size
loop (ii,1,5)
{begin=(ii-1)*nsize+1; end=ii*nsize;
limit col(a) -b begin -e end;
max$(ii)=limit.ymax; min$(ii)=limit.ymin;
};//varible max1 to max5 contains the max value of each area from the top down, the same as min1 - min5

P.S. If the number of column elements is not a multiple of 5, you may use functons like int() and mod() to get the last area size.

An USTCer always keep trying.

Edited by - adamleewiner on 08/06/2008 7:57:38 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000