Hi,
The following script can get the X value when Y is maximum (suppose the worksheet that has the data is active):
//Set the index numbers for X and Y columns
xx=1;
yy=2;
%a = %(%h,yy); //Get the Y dataset name
limit %a;
%b = limit.imax; //The index of the maximum value
//Type results
type Peak X: %(%h, xx, %b);
type Peak Y: %(%h, yy, %b);
Note that the maximum Y is not necessarily the peak position.
Deanna
OriginLab Technical Services