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
 max operation with corresponding x retrieve
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ticofiz

United Kingdom
21 Posts

Posted - 03/19/2018 :  4:40:25 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Hideo Fujii

USA
1582 Posts

Posted - 03/19/2018 :  5:37:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - Hideo Fujii on 03/19/2018 5:42:20 PM
Go to Top of Page

ticofiz

United Kingdom
21 Posts

Posted - 03/19/2018 :  5:48:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, it is exactly what I need.

Many thanks and best wishes
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