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
 max operation with corresponding x retrieve

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
ticofiz Posted - 03/19/2018 : 4:40:25 PM
Origin Ver.9.1 and Service Release SR2
Operating System: W10 Home

Hello,

I am trying to find the maximum value in each column and for each maximum, I want to find its corresponding X value. I found this command
xvalue(list(max(col(B)),col(B)),col(B)) but I have no idea how to make it work for multiple columns and with the output in anew worksheet. Could you please give me an idea how to do it?
Also, isn't there an easier way to do this operation from "Statistics on columns"? I can get from there the index number but not x.

Many thanks
2   L A T E S T    R E P L I E S    (Newest First)
ticofiz Posted - 03/19/2018 : 5:48:41 PM
Yes, it is exactly what I need.

Many thanks and best wishes
Hideo Fujii Posted - 03/19/2018 : 5:37:34 PM
Hi ticofiz,

For Y columns in the active worksheet, can you try the following?
doc -e DY {  //loop over all Y columns in the active worksheet
  range ri=%C;                       //current Y col
  cn=colnum(%C);                     //its column number
  range ro=[maxX]!wcol(cn);          //output column
  ro[1]=xvalue(list(max(ri),ri),ri); //put the X of max to 1st row
}
Hope this works as you wanted.

--Hideo Fujii
OriginLab

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