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
Maximum in Worksheet
New Topic
Reply to Topic
Printer Friendly
Author
Topic
abreiti
Germany
Posts
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
greg
USA
1378 Posts
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);
Edited by - greg on 05/05/2010 4:30:40 PM
abreiti
Germany
Posts
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);
}
}
Topic
New Topic
Reply to Topic
Printer Friendly
Jump To:
Select Forum
Origin Forum
Origin Viewer Forum
Origin Forum
Origin Forum for Programming
Forum for Python
LabTalk Forum
Forum for Origin C
Forum for Automation Server/COM and LabVIEW
Origin中文论坛
Origin 中文论坛 (Chinese Origin Forum)
Japanese Origin Forum
Origin日本語フォーラム (Japanese Origin Forum)
Origin on Linux
The Origin on Linux Forum
Private Forums
Distributor Forum
--------------------
Home
Active Topics
Frequently Asked Questions
Member Information
Search Page
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000