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
Origin Forum
using column value as an address
New Topic
Reply to Topic
Printer Friendly
Author
Topic
naeem498
17 Posts
Posted - 05/07/2012 : 02:57:26 AM
Hi,
Can I make a value in a column as an address. e.g. I want to see maximum value in col(B) and take the value of col(A) in the same row then put it in col(C).
Col (A) Col (B)
12 23
23 16
44 19
Now I want to take 12 into col(C).
Hideo Fujii
USA
1582 Posts
Posted - 05/07/2012 : 10:03:02 AM
Hi naeem498
Please try the following two-line script:
sum(col(B));
col(C)[col(A)[sum.imax]]=sum.max;
It puts the max value of col(B), 23 at the 12th(as indicated in col(A)) row of col(C).
--Hideo Fujii
OriginLab
Edited by - Hideo Fujii on 05/07/2012 10:29:59 AM
naeem498
17 Posts
Posted - 05/08/2012 : 02:53:12 AM
Thank you Hideo, I am sorry for not being clear enough. In col(C) I want the value of col(A) not col(B).
In col(B) lets say 23 is the highest number at row 10. Now I want the value of col(A) in row 10 to be copied in col(C).
Hideo Fujii
USA
1582 Posts
Posted - 05/08/2012 : 10:10:36 AM
Hi naeem498,
Then,
sum(col(B));
col(C)[sum.imax]=col(A)[sum.imax];
though this goes apart from your title "using column value as an address".
Hope this is what you wanted.
--Hideo Fujii
OriginLab
naeem498
17 Posts
Posted - 05/10/2012 : 02:46:19 AM
Thank you
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