| T O P I C R E V I E W |
| eno |
Posted - 02/15/2005 : 04:25:48 AM Origin Version (Select Help-->About Origin): 7.5SR5 Operating System: Win 2000SV
Is there any command to get an index number where the specific data stored? The following is an example.
index,col_a 1,-2.7 2,-2.7 3,-11.6 4,8.8 5,6
If I want to get the index of max data, the following scripts become too complicated! Especially when the data length is very long and I have to devide the data using "set -bs" and "set -es" commands.
sum(data_a); loop(ii,1,wks.nrows) { if(data_a[ii]==sum.max) { index=ii; first=ii; break; }; }; type $(index);
eno
|
| 2 L A T E S T R E P L I E S (Newest First) |
| eno |
Posted - 02/15/2005 : 7:12:09 PM Much easier! Thank you.
eno
|
| Mike Buess |
Posted - 02/15/2005 : 07:50:57 AM In your example you can use the limit command. Following gets the max value and its index in rows 101 to 200...
limit data_a -b 101 -e 200; ymax=limit.ymax; // max Y value in range imax=limit.imax; // index of that value
If you want the index for a specific value other than min or max use the list function...
i=list(123.456,data_a);
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 02/15/2005 08:09:22 AM |
|
|