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 for Programming
 LabTalk Forum
 Maximum in Worksheet

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
abreiti Posted - 05/04/2010 : 11:34:47 AM
Hello,

is there any possibility to find the maximum over all columns in a worksheet.

I need the maximum and the correspondending column number.

Thnaks,

abreiti
2   L A T E S T    R E P L I E S    (Newest First)
abreiti Posted - 05/06/2010 : 10:58:58 AM
Thank's for the input. It doesn't worked with my Origin 7.5, but with the above information I found a solution that worked very well.

max = 0;
maxCOL = 0;
maxROW = 0;

loop(ii,1,wks.ncols)
{
%n=%h!wks.col$(ii).name$;
%q=%h_%n;
limit %q;
type "max $(LIMIT.YMAX)";
if($(LIMIT.YMAX) >= $(max))
{
max = $(LIMIT.YMAX);
maxCOL = $(ii);
maxROW = $(LIMIT.IMAX);
}
}
greg Posted - 05/05/2010 : 4:30:20 PM
This should do it:

maxval = -1e300;
maxcol = 0;
loop(ii,1,wks.ncols)
{
val = max(wcol(ii));
if(val > maxval)
{
maxval = val;
maxcol = ii;
}
}
ty Maximum of $(maxval) occurs in column $(maxcol);

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